Add virtio_s390_device_plugged, it can be used to get backend's features. Signed-off-by: Shannon Zhao <zhaoshengl...@huawei.com> Signed-off-by: Shannon Zhao <shannon.z...@linaro.org> --- 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