[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 18/47] vhost: Use vbus var instead of VIRTIO_BUS() ma
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 18/47] vhost: Use vbus var instead of VIRTIO_BUS() macro |
Date: |
Thu, 10 Nov 2016 18:13:16 +0200 |
From: Felipe Franciosi <address@hidden>
Recent changes on vhost_dev_enable/disable_notifiers() produced a
VirtioBusState vbus variable which can be used instead of the
VIRTIO_BUS() macro. This commit just makes the code a little bit cleaner
and more consistent.
Signed-off-by: Felipe Franciosi <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/virtio/vhost.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 1290963..7d29dad 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1198,20 +1198,18 @@ int vhost_dev_enable_notifiers(struct vhost_dev *hdev,
VirtIODevice *vdev)
virtio_device_stop_ioeventfd(vdev);
for (i = 0; i < hdev->nvqs; ++i) {
- r = virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), hdev->vq_index + i,
- true);
+ r = virtio_bus_set_host_notifier(vbus, hdev->vq_index + i, true);
if (r < 0) {
error_report("vhost VQ %d notifier binding failed: %d", i, -r);
goto fail_vq;
}
}
- VIRTIO_BUS(qbus)->ioeventfd_started = true;
+ vbus->ioeventfd_started = true;
return 0;
fail_vq:
while (--i >= 0) {
- e = virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), hdev->vq_index + i,
- false);
+ e = virtio_bus_set_host_notifier(vbus, hdev->vq_index + i, false);
if (e < 0) {
error_report("vhost VQ %d notifier cleanup error: %d", i, -r);
}
@@ -1230,17 +1228,17 @@ fail:
void vhost_dev_disable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev)
{
BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev)));
+ VirtioBusState *vbus = VIRTIO_BUS(qbus);
int i, r;
for (i = 0; i < hdev->nvqs; ++i) {
- r = virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), hdev->vq_index + i,
- false);
+ r = virtio_bus_set_host_notifier(vbus, hdev->vq_index + i, false);
if (r < 0) {
error_report("vhost VQ %d notifier cleanup failed: %d", i, -r);
}
assert (r >= 0);
}
- VIRTIO_BUS(qbus)->ioeventfd_started = false;
+ vbus->ioeventfd_started = false;
virtio_device_start_ioeventfd(vdev);
}
--
MST
- [Qemu-devel] [PULL 09/47] virtio: make virtqueue_alloc_element static, (continued)
- [Qemu-devel] [PULL 09/47] virtio: make virtqueue_alloc_element static, Michael S. Tsirkin, 2016/11/10
- [Qemu-devel] [PULL 08/47] virtio: rename virtqueue_discard to virtqueue_unpop, Michael S. Tsirkin, 2016/11/10
- [Qemu-devel] [PULL 10/47] pcie_aer: Convert pcie_aer_init to Error, Michael S. Tsirkin, 2016/11/10
- [Qemu-devel] [PULL 12/47] intel_iommu: fix several incorrect endianess and bit fields, Michael S. Tsirkin, 2016/11/10
- [Qemu-devel] [PULL 11/47] virtio-crypto: tag as not hotpluggable and migration, Michael S. Tsirkin, 2016/11/10
- [Qemu-devel] [PULL 13/47] intel_iommu: fix incorrect assert, Michael S. Tsirkin, 2016/11/10
- [Qemu-devel] [PULL 14/47] acpi: fix DMAR device scope for IOAPIC, Michael S. Tsirkin, 2016/11/10
- [Qemu-devel] [PULL 15/47] virtio: allow per-device-class legacy features, Michael S. Tsirkin, 2016/11/10
- [Qemu-devel] [PULL 16/47] virtio-net: mark VIRTIO_NET_F_GSO as legacy, Michael S. Tsirkin, 2016/11/10
- [Qemu-devel] [PULL 17/47] vhost: Update 'ioeventfd_started' with host notifiers, Michael S. Tsirkin, 2016/11/10
- [Qemu-devel] [PULL 18/47] vhost: Use vbus var instead of VIRTIO_BUS() macro,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 19/47] vhost: migration blocker only if shared log is used, Michael S. Tsirkin, 2016/11/10
- [Qemu-devel] [PULL 20/47] qdev: hotplug: drop HotplugHandler.post_plug callback, Michael S. Tsirkin, 2016/11/10
- [Qemu-devel] [PULL 21/47] nvdimm acpi: drop the lock of fit buffer, Michael S. Tsirkin, 2016/11/10
- [Qemu-devel] [PULL 22/47] pc: memhp: move nvdimm hotplug out of memory hotplug, Michael S. Tsirkin, 2016/11/10
- [Qemu-devel] [PULL 24/47] nvdimm acpi: clean up nvdimm_build_acpi, Michael S. Tsirkin, 2016/11/10
- [Qemu-devel] [PULL 23/47] pc: memhp: stop handling nvdimm hotplug in pc_dimm_unplug, Michael S. Tsirkin, 2016/11/10
- [Qemu-devel] [PULL 25/47] docs: improve the doc of Read FIT method, Michael S. Tsirkin, 2016/11/10
- [Qemu-devel] [PULL 27/47] nvdimm acpi: cleanup nvdimm_build_fit, Michael S. Tsirkin, 2016/11/10
- [Qemu-devel] [PULL 26/47] nvdimm acpi: rename nvdimm_plugged_device_list, Michael S. Tsirkin, 2016/11/10
- [Qemu-devel] [PULL 28/47] nvdimm acpi: rename nvdimm_acpi_hotplug, Michael S. Tsirkin, 2016/11/10