Hi guys, Here is RFC patch to add feature to start QEMU without vhost-user backend. Currently, if we want to use vhost-user backend, the backend must start before QEMU. Also, if QEMU or the backend is closed unexpectedly, there is no way to recover without restarting both applications. Practically, it's not useful.
This patch series adds following features. - QEMU can start before the backend. - QEMU or the backend can restart anytime. connectivity will be recovered automatically, when app starts again. (if QEMU is server, QEMU just wait reconnection) while lost connection, link status of virtio-net device is down, so virtio-net driver on the guest can know it To work like above, the patch introduces backend_features flag. Here are examples. -chardev socket,id=chr0,path=/tmp/sock0,reconnect=3 \ -netdev vhost-user,id=net0,chardev=chr0,vhostforce,backend_features=0x68000 \ -device virtio-net-pci,netdev=net0 \ \ -chardev socket,id=chr1,path=/tmp/sock1,server,nowait \ -netdev vhost-user,id=net1,chardev=chr1,vhostforce,backend_features=0x68000 \ -device virtio-net-pci,netdev=net1 \ When virtio-net device is configured by virtio-net driver, QEMU should know vhost-user backend features. But if QEMU starts without the backend, QEMU cannot know it. So above the feature values specified by user will be used as features the backend will support. When connection between QEMU and the backend is established, QEMU checkes feature values of the backend to make sure the expected features are provided. If it doesn't, the connection will be closed by QEMU. Regards, Tetsuya Tetsuya Mukawa (4): vhost-user: Add ability to know vhost-user backend disconnection vhost-user: Shutdown vhost-user connection when wrong messages are passed vhost-user: Enable 'nowait' and 'reconnect' option vhost-user: Add new option to specify vhost-user backend supports hw/net/vhost_net.c | 9 +++++- hw/net/virtio-net.c | 24 ++++++++++++++++ hw/scsi/vhost-scsi.c | 2 +- hw/virtio/vhost-user.c | 26 +++++++++++++----- hw/virtio/vhost.c | 8 ++++-- include/hw/virtio/vhost.h | 5 +++- include/hw/virtio/virtio-net.h | 2 ++ include/net/net.h | 6 ++++ include/net/vhost_net.h | 2 ++ include/sysemu/char.h | 7 +++++ net/net.c | 18 ++++++++++++ net/tap.c | 5 +++- net/vhost-user.c | 62 ++++++++++++++++++++++++++++++++++++++++-- qapi-schema.json | 10 +++++-- qemu-char.c | 15 ++++++++++ qemu-options.hx | 3 +- 16 files changed, 186 insertions(+), 18 deletions(-) -- 2.1.4