Skip to content

Support host notifier in libvhost-user and vhost-user-bridge

Tiwei Bie qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2libvhost-user: support host notifiercontrib/libvhost-user/libvhost-user.c contrib/libvhost-user/libvhost-user.h+99 -80 replies
2/2vhost-user-bridge: support host notifiertests/vhost-user-bridge.c+95 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/2] Support host notifier in libvhost-user and vhost-user-bridge

This patch set extends libvhost-user and vhost-user-bridge to support the host notifier [1] feature in vhost user.

A new API is added for libvhost-user to support setting host notifier for each queue:

/**
* vu_set_queue_host_notifier:
* @dev: a VuDev context
* @vq: a VuVirtq queue
* @fd: a file descriptor
* @size: host page size
* @offset: notifier offset in @fd file
*
* Set queue's host notifier. This function may be called several
* times for the same queue. If called with -1 @fd, the notifier
* is removed.
*/
bool vu_set_queue_host_notifier(VuDev *dev, VuVirtq *vq, int fd,

                                int size, int offset);

A new option (-H) is added for vhost-user-bridge to enable the host notifier. It's pretty simple to test:

# Launch vhost-user-bridge with host notifier enabled

$ make tests/vhost-user-bridge
$ ./tests/vhost-user-bridge -H

# Launch QEMU on another terminal

$ ./x86_64-softmmu/qemu-system-x86_64 \
        -smp 4 -m 1024M -cpu host -enable-kvm \
        -hda "$DISK" \
        -object memory-backend-file,id=mem,size=1024M,mem-path=/dev/shm,share=on \
        -numa node,memdev=mem -mem-prealloc \
        -chardev socket,id=char0,path=/tmp/vubr.sock \
        -netdev type=vhost-user,id=net0,chardev=char0 \
        -device virtio-net-pci,netdev=net0,page-per-vq=on

More details can be found from the patches.

Thanks!

[1] http://lists.nongnu.org/archive/html/qemu-devel/2018-04/msg01779.html

Tiwei Bie (2):
libvhost-user: support host notifier
vhost-user-bridge: support host notifier

 contrib/libvhost-user/libvhost-user.c | 76 ++++++++++++++++++++++++---
 contrib/libvhost-user/libvhost-user.h | 31 +++++++++++
 tests/vhost-user-bridge.c             | 98 +++++++++++++++++++++++++++++++++--
 3 files changed, 194 insertions(+), 11 deletions(-)
Signature · 1 line
2.11.0