]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
virtio: move VIRTIO_F_NOTIFY_ON_EMPTY into core
authorCornelia Huck <cornelia.huck@de.ibm.com>
Fri, 29 May 2015 09:29:40 +0000 (11:29 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 31 May 2015 14:27:25 +0000 (16:27 +0200)
Nearly all transports have been offering VIRTIO_F_NOTIFY_ON_EMPTY,
s390-virtio being the exception. There's no reason why it shouldn't
offer it as well, though (handling is done in core anyway), so let's
move it to the common virtio features.

While we're changing it anyway, fix the indentation for the
DEFINE_VIRTIO_COMMON_FEATURES macro.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/s390x/virtio-ccw.c
hw/virtio/virtio-mmio.c
hw/virtio/virtio-pci.c
include/hw/virtio/virtio.h

index b7c07ef62e3606b4b60f9b89e69c8451534833fe..e7722659b7edc743e8f6eb38a0ef54e78c7edeff 100644 (file)
@@ -1382,12 +1382,9 @@ static void virtio_ccw_device_plugged(DeviceState *d)
 {
     VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(d);
     SubchDev *sch = dev->sch;
-    VirtIODevice *vdev = virtio_ccw_get_vdev(sch);
 
     sch->id.cu_model = virtio_bus_get_vdev_id(&dev->bus);
 
-    virtio_add_feature(&vdev->host_features, VIRTIO_F_NOTIFY_ON_EMPTY);
-
     css_generate_sch_crws(sch->cssid, sch->ssid, sch->schid,
                           d->hotplugged, 1);
 }
index 1817a0784535c1ce7f15ef3ac92a55d1fc1616a1..3008b65aa977293aed892a4c18427ef3b55da31e 100644 (file)
@@ -336,15 +336,6 @@ static void virtio_mmio_reset(DeviceState *d)
 
 /* virtio-mmio device */
 
-/* This is called by virtio-bus just after the device is plugged. */
-static void virtio_mmio_device_plugged(DeviceState *opaque)
-{
-    VirtIOMMIOProxy *proxy = VIRTIO_MMIO(opaque);
-    VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
-
-    virtio_add_feature(&vdev->host_features, VIRTIO_F_NOTIFY_ON_EMPTY);
-}
-
 static void virtio_mmio_realizefn(DeviceState *d, Error **errp)
 {
     VirtIOMMIOProxy *proxy = VIRTIO_MMIO(d);
@@ -384,7 +375,6 @@ static void virtio_mmio_bus_class_init(ObjectClass *klass, void *data)
     k->notify = virtio_mmio_update_irq;
     k->save_config = virtio_mmio_save_config;
     k->load_config = virtio_mmio_load_config;
-    k->device_plugged = virtio_mmio_device_plugged;
     k->has_variable_vring_alignment = true;
     bus_class->max_dev = 1;
 }
index 8ea723106deb7087c68931184b000a329977e060..8923ba86e0c896bb66a9fe68506ea3594575e394 100644 (file)
@@ -953,7 +953,6 @@ static void virtio_pci_device_plugged(DeviceState *d)
         proxy->flags &= ~VIRTIO_PCI_FLAG_USE_IOEVENTFD;
     }
 
-    virtio_add_feature(&vdev->host_features, VIRTIO_F_NOTIFY_ON_EMPTY);
     virtio_add_feature(&vdev->host_features, VIRTIO_F_BAD_FEATURE);
 }
 
index f1f9ca5b17dae1b3c26db31091ad3d4bf4fbbfec..5244a3e016e5b2271fc846afbd32dc110bb5d337 100644 (file)
@@ -194,10 +194,12 @@ typedef struct VirtIOSCSIConf VirtIOSCSIConf;
 typedef struct VirtIORNGConf VirtIORNGConf;
 
 #define DEFINE_VIRTIO_COMMON_FEATURES(_state, _field) \
-       DEFINE_PROP_BIT("indirect_desc", _state, _field, \
-                       VIRTIO_RING_F_INDIRECT_DESC, true), \
-       DEFINE_PROP_BIT("event_idx", _state, _field, \
-                       VIRTIO_RING_F_EVENT_IDX, true)
+    DEFINE_PROP_BIT("indirect_desc", _state, _field,    \
+                    VIRTIO_RING_F_INDIRECT_DESC, true), \
+    DEFINE_PROP_BIT("event_idx", _state, _field,        \
+                    VIRTIO_RING_F_EVENT_IDX, true),     \
+    DEFINE_PROP_BIT("notify_on_empty", _state, _field,  \
+                    VIRTIO_F_NOTIFY_ON_EMPTY, true)
 
 hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n);
 hwaddr virtio_queue_get_avail_addr(VirtIODevice *vdev, int n);