qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/4] hw/s390x/s390-virtio-bus: Add virtio_s390_devic


From: Shannon Zhao
Subject: [Qemu-devel] [PATCH 2/4] hw/s390x/s390-virtio-bus: Add virtio_s390_device_plugged for s390-virtio
Date: Fri, 17 Apr 2015 20:13:44 +0800

Add virtio_s390_device_plugged, it can be used to get backend's features.

Signed-off-by: Shannon Zhao <address@hidden>
Signed-off-by: Shannon Zhao <address@hidden>
---
 hw/s390x/s390-virtio-bus.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
index 047c963..31fdf94 100644
--- a/hw/s390x/s390-virtio-bus.c
+++ b/hw/s390x/s390-virtio-bus.c
@@ -504,6 +504,15 @@ static unsigned virtio_s390_get_features(DeviceState *d)
     return dev->host_features;
 }
 
+/* This is called by virtio-bus just after the device is plugged. */
+static void virtio_s390_device_plugged(DeviceState *d)
+{
+    VirtIOS390Device *dev = to_virtio_s390_device(d);
+
+    dev->host_features = virtio_bus_get_vdev_features(&dev->bus,
+                                                      dev->host_features);
+}
+
 /**************** S390 Virtio Bus Device Descriptions *******************/
 
 static Property s390_virtio_net_properties[] = {
@@ -715,6 +724,7 @@ static void virtio_s390_bus_class_init(ObjectClass *klass, 
void *data)
     bus_class->max_dev = 1;
     k->notify = virtio_s390_notify;
     k->get_features = virtio_s390_get_features;
+    k->device_plugged = virtio_s390_device_plugged;
 }
 
 static const TypeInfo virtio_s390_bus_info = {
-- 
2.0.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]