[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 11/23] vring: make vring_enable_notification return v
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 11/23] vring: make vring_enable_notification return void |
Date: |
Wed, 24 Feb 2016 22:35:41 +0200 |
From: Paolo Bonzini <address@hidden>
Make the API more similar to the regular virtqueue API. This will
help when modifying the code to not use vring.c anymore.
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Acked-by: Cornelia Huck <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Acked-by: Stefan Hajnoczi <address@hidden>
---
include/hw/virtio/dataplane/vring.h | 2 +-
hw/block/dataplane/virtio-blk.c | 3 ++-
hw/virtio/dataplane/vring.c | 3 +--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/hw/virtio/dataplane/vring.h
b/include/hw/virtio/dataplane/vring.h
index e80985e..e1c2a65 100644
--- a/include/hw/virtio/dataplane/vring.h
+++ b/include/hw/virtio/dataplane/vring.h
@@ -42,7 +42,7 @@ static inline void vring_set_broken(Vring *vring)
bool vring_setup(Vring *vring, VirtIODevice *vdev, int n);
void vring_teardown(Vring *vring, VirtIODevice *vdev, int n);
void vring_disable_notification(VirtIODevice *vdev, Vring *vring);
-bool vring_enable_notification(VirtIODevice *vdev, Vring *vring);
+void vring_enable_notification(VirtIODevice *vdev, Vring *vring);
bool vring_should_notify(VirtIODevice *vdev, Vring *vring);
void *vring_pop(VirtIODevice *vdev, Vring *vring, size_t sz);
void vring_push(VirtIODevice *vdev, Vring *vring, VirtQueueElement *elem,
diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c
index 0d99781..03b81bc 100644
--- a/hw/block/dataplane/virtio-blk.c
+++ b/hw/block/dataplane/virtio-blk.c
@@ -128,7 +128,8 @@ static void handle_notify(EventNotifier *e)
/* Re-enable guest->host notifies and stop processing the vring.
* But if the guest has snuck in more descriptors, keep processing.
*/
- if (vring_enable_notification(s->vdev, &s->vring)) {
+ vring_enable_notification(s->vdev, &s->vring);
+ if (!vring_more_avail(s->vdev, &s->vring)) {
break;
}
} else { /* fatal error */
diff --git a/hw/virtio/dataplane/vring.c b/hw/virtio/dataplane/vring.c
index 4308d9f..157e8b8 100644
--- a/hw/virtio/dataplane/vring.c
+++ b/hw/virtio/dataplane/vring.c
@@ -175,7 +175,7 @@ void vring_disable_notification(VirtIODevice *vdev, Vring
*vring)
*
* Return true if the vring is empty, false if there are more requests.
*/
-bool vring_enable_notification(VirtIODevice *vdev, Vring *vring)
+void vring_enable_notification(VirtIODevice *vdev, Vring *vring)
{
if (virtio_vdev_has_feature(vdev, VIRTIO_RING_F_EVENT_IDX)) {
vring_avail_event(&vring->vr) = vring->vr.avail->idx;
@@ -183,7 +183,6 @@ bool vring_enable_notification(VirtIODevice *vdev, Vring
*vring)
vring_clear_used_flags(vdev, vring, VRING_USED_F_NO_NOTIFY);
}
smp_mb(); /* ensure update is seen before reading avail_idx */
- return !vring_more_avail(vdev, vring);
}
/* This is stolen from linux/drivers/vhost/vhost.c:vhost_notify() */
--
MST
- [Qemu-devel] [PULL 02/23] vhost-user: don't merge regions with different fds, (continued)
- [Qemu-devel] [PULL 02/23] vhost-user: don't merge regions with different fds, Michael S. Tsirkin, 2016/02/24
- [Qemu-devel] [PULL 01/23] bios-linker-loader: document+validate input, Michael S. Tsirkin, 2016/02/24
- [Qemu-devel] [PULL 03/23] move get_current_ram_size to virtio-balloon.c, Michael S. Tsirkin, 2016/02/24
- [Qemu-devel] [PULL 04/23] pc-dimm: rename pc_dimm_built_list(), Michael S. Tsirkin, 2016/02/24
- [Qemu-devel] [PULL 05/23] pc-dimm: add pc_dimm_build_list(), Michael S. Tsirkin, 2016/02/24
- [Qemu-devel] [PULL 06/23] virtio-balloon: rewrite get_current_ram_size(), Michael S. Tsirkin, 2016/02/24
- [Qemu-devel] [PULL 07/23] balloon: Use only 'pc-dimm' type dimm for ballooning, Michael S. Tsirkin, 2016/02/24
- [Qemu-devel] [PULL 08/23] pci core: function pci_host_bus_register() cleanup, Michael S. Tsirkin, 2016/02/24
- [Qemu-devel] [PULL 09/23] pci core: function pci_bus_init() cleanup, Michael S. Tsirkin, 2016/02/24
- [Qemu-devel] [PULL 10/23] block-migration: acquire AioContext as necessary, Michael S. Tsirkin, 2016/02/24
- [Qemu-devel] [PULL 11/23] vring: make vring_enable_notification return void,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 12/23] virtio: add AioContext-specific function for host notifiers, Michael S. Tsirkin, 2016/02/24
- [Qemu-devel] [PULL 13/23] virtio: export vring_notify as virtio_should_notify, Michael S. Tsirkin, 2016/02/24
- [Qemu-devel] [PULL 14/23] virtio-blk: fix "disabled data plane" mode, Michael S. Tsirkin, 2016/02/24
- [Qemu-devel] [PULL 16/23] virtio-scsi: do not use vring in dataplane, Michael S. Tsirkin, 2016/02/24
- [Qemu-devel] [PULL 15/23] virtio-blk: do not use vring in dataplane, Michael S. Tsirkin, 2016/02/24
- [Qemu-devel] [PULL 17/23] vring: remove, Michael S. Tsirkin, 2016/02/24
- [Qemu-devel] [PULL 18/23] tests/vhost-user-bridge: fix build on 32 bit systems, Michael S. Tsirkin, 2016/02/24
- [Qemu-devel] [PULL 19/23] q35: Remove old machine versions, Michael S. Tsirkin, 2016/02/24
- [Qemu-devel] [PULL 20/23] machine: Remove no_tco field, Michael S. Tsirkin, 2016/02/24
- [Qemu-devel] [PULL 21/23] ich9: Remove enable_tco arguments from init functions, Michael S. Tsirkin, 2016/02/24