Closed bergwolf closed 7 years ago
The PR changes qemu driver to support vsock device in guest vm:
with https://github.com/hyperhq/hyperstart/pull/194, and also vsock qemu change (https://github.com/stefanha/qemu/tree/vsock), guest/guest are reachable to each other via vsock socket.
on guest
root@ubuntu-6153805562:/# ./nc-vsock -l 1234 Connection from cid 2 port 1028...
on host, find out guest-cid (1028) in this case
[hyperpublic@~]$pa|grep vsock root 83670 18.3 12.1 551376 217920 ? Sl 11:10 1:27 /usr/bin/qemu-system-x86_64 -machine pc-i440fx-2.0,accel=kvm,usb=off -global kvm-pit.lost_tick_policy=discard -cpu host -kernel /var/lib/hyper/kernel -initrd /var/lib/hyper/hyper-initrd.img -append console=ttyS0 panic=1 no_timer_check -realtime mlock=off -no-user-config -nodefaults -no-hpet -rtc base=utc,driftfix=slew -no-reboot -display none -boot strict=on -m 128 -smp 1 -qmp unix:/var/run/hyper/vm-QLJXyoRlBs/qmp.sock,server,nowait -serial unix:/var/run/hyper/vm-QLJXyoRlBs/console.sock,server,nowait -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x2 -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 -chardev socket,id=charch0,path=/var/run/hyper/vm-QLJXyoRlBs/hyper.sock,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charch0,id=channel0,name=sh.hyper.channel.0 -chardev socket,id=charch1,path=/var/run/hyper/vm-QLJXyoRlBs/tty.sock,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charch1,id=channel1,name=sh.hyper.channel.1 -fsdev local,id=virtio9p,path=/var/run/hyper/vm-QLJXyoRlBs/share_dir,security_model=none -device virtio-9p-pci,fsdev=virtio9p,mount_tag=share_dir -daemonize -pidfile /var/run/hyper/vm-QLJXyoRlBs/pidfile -D /var/log/hyper/qemu/vm-QLJXyoRlBs.log -device vhost-vsock-pci,id=vsock0,bus=pci.0,addr=6,guest-cid=1028 [hyperpublic@~]$./nc-vsock 1028 1234
I think we still need a global switch to enable/disable vsock support. I'll see to it next.
Last commit ("add a global switch to enable vsock support") addresses the global switch.
The PR changes qemu driver to support vsock device in guest vm:
with https://github.com/hyperhq/hyperstart/pull/194, and also vsock qemu change (https://github.com/stefanha/qemu/tree/vsock), guest/guest are reachable to each other via vsock socket.
on guest
on host, find out guest-cid (1028) in this case
I think we still need a global switch to enable/disable vsock support. I'll see to it next.