From a0f80010b37afc18030d43f2b96cc1e0b7588b73 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 24 Oct 2016 11:13:49 +0200 Subject: stubs: move vhost stubs to stubs/vhost.o No need to include them in libqemustub.a, since only system emulators need them. Signed-off-by: Paolo Bonzini --- hw/virtio/Makefile.objs | 6 +++++- hw/virtio/vhost-stub.c | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 hw/virtio/vhost-stub.c (limited to 'hw/virtio') diff --git a/hw/virtio/Makefile.objs b/hw/virtio/Makefile.objs index 95c4c30ea1..765d363c1f 100644 --- a/hw/virtio/Makefile.objs +++ b/hw/virtio/Makefile.objs @@ -1,3 +1,4 @@ +ifeq ($(CONFIG_VIRTIO),y) common-obj-y += virtio-rng.o common-obj-$(CONFIG_VIRTIO_PCI) += virtio-pci.o common-obj-y += virtio-bus.o @@ -5,7 +6,10 @@ common-obj-y += virtio-mmio.o obj-y += virtio.o virtio-balloon.o obj-$(CONFIG_LINUX) += vhost.o vhost-backend.o vhost-user.o - obj-$(CONFIG_VHOST_VSOCK) += vhost-vsock.o obj-y += virtio-crypto.o obj-$(CONFIG_VIRTIO_PCI) += virtio-crypto-pci.o +endif + +common-obj-$(call lnot,$(CONFIG_LINUX)) += vhost-stub.o +common-obj-$(CONFIG_ALL) += vhost-stub.o diff --git a/hw/virtio/vhost-stub.c b/hw/virtio/vhost-stub.c new file mode 100644 index 0000000000..2d76cdebdc --- /dev/null +++ b/hw/virtio/vhost-stub.c @@ -0,0 +1,7 @@ +#include "qemu/osdep.h" +#include "hw/virtio/vhost.h" + +bool vhost_has_free_slot(void) +{ + return true; +} -- cgit v1.2.3 From d6da1e9eca939e8f9d41639be17c4bf5af7d5625 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 10 Jan 2017 11:54:52 +0100 Subject: event_notifier: cleanups around event_notifier_set_handler Remove the useless is_external argument. Since the iohandler AioContext is never used for block devices, aio_disable_external is never called on it. This lets us remove stubs/iohandler.c. Signed-off-by: Paolo Bonzini --- hw/virtio/virtio.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'hw/virtio') diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index aa4f38f50a..a181514b49 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -2090,10 +2090,10 @@ void virtio_queue_set_guest_notifier_fd_handler(VirtQueue *vq, bool assign, bool with_irqfd) { if (assign && !with_irqfd) { - event_notifier_set_handler(&vq->guest_notifier, false, + event_notifier_set_handler(&vq->guest_notifier, virtio_queue_guest_notifier_read); } else { - event_notifier_set_handler(&vq->guest_notifier, false, NULL); + event_notifier_set_handler(&vq->guest_notifier, NULL); } if (!assign) { /* Test and clear notifier before closing it, @@ -2262,7 +2262,7 @@ static int virtio_device_start_ioeventfd_impl(VirtIODevice *vdev) err = r; goto assign_error; } - event_notifier_set_handler(&vq->host_notifier, true, + event_notifier_set_handler(&vq->host_notifier, virtio_queue_host_notifier_read); } @@ -2283,7 +2283,7 @@ assign_error: continue; } - event_notifier_set_handler(&vq->host_notifier, true, NULL); + event_notifier_set_handler(&vq->host_notifier, NULL); r = virtio_bus_set_host_notifier(qbus, n, false); assert(r >= 0); } @@ -2309,7 +2309,7 @@ static void virtio_device_stop_ioeventfd_impl(VirtIODevice *vdev) if (!virtio_queue_get_num(vdev, n)) { continue; } - event_notifier_set_handler(&vq->host_notifier, true, NULL); + event_notifier_set_handler(&vq->host_notifier, NULL); r = virtio_bus_set_host_notifier(qbus, n, false); assert(r >= 0); } -- cgit v1.2.3