[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/5] s390-virtio: use common features
From: |
Shannon Zhao |
Subject: |
Re: [Qemu-devel] [PATCH 2/5] s390-virtio: use common features |
Date: |
Tue, 05 May 2015 08:32:34 +0800 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
On 2015/5/4 23:28, Cornelia Huck wrote:
> We used to avoid enabling event_idx for virtio-blk devices via
> s390-virtio, but we now have a workaround in place for guests trying
> to use the device before setting DRIVER_OK. Therefore, let's add
> DEFINE_VIRTIO_COMMON_FEATURES to the base device so all devices get
> those common features - and make s390-virtio use the same mechanism
> as the other transports do.
>
> Acked-by: Christian Borntraeger <address@hidden>
> Signed-off-by: Cornelia Huck <address@hidden>
Reviewed-by: Shannon Zhao <address@hidden>
> ---
> hw/s390x/s390-virtio-bus.c | 20 ++++++--------------
> 1 file changed, 6 insertions(+), 14 deletions(-)
>
> diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
> index c27f8a5..4a33c6a 100644
> --- a/hw/s390x/s390-virtio-bus.c
> +++ b/hw/s390x/s390-virtio-bus.c
> @@ -530,7 +530,6 @@ static unsigned virtio_s390_get_features(DeviceState *d)
> /**************** S390 Virtio Bus Device Descriptions *******************/
>
> static Property s390_virtio_net_properties[] = {
> - DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features),
> DEFINE_VIRTIO_NET_FEATURES(VirtIOS390Device, host_features),
> DEFINE_PROP_END_OF_LIST(),
> };
> @@ -592,18 +591,12 @@ static const TypeInfo s390_virtio_serial = {
> .class_init = s390_virtio_serial_class_init,
> };
>
> -static Property s390_virtio_rng_properties[] = {
> - DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features),
> - DEFINE_PROP_END_OF_LIST(),
> -};
> -
> static void s390_virtio_rng_class_init(ObjectClass *klass, void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
> VirtIOS390DeviceClass *k = VIRTIO_S390_DEVICE_CLASS(klass);
>
> k->realize = s390_virtio_rng_realize;
> - dc->props = s390_virtio_rng_properties;
> set_bit(DEVICE_CATEGORY_MISC, dc->categories);
> }
>
> @@ -632,10 +625,16 @@ static void s390_virtio_busdev_reset(DeviceState *dev)
> virtio_reset(_dev->vdev);
> }
>
> +static Property virtio_s390_properties[] = {
> + DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features),
> + DEFINE_PROP_END_OF_LIST(),
> +};
> +
> static void virtio_s390_device_class_init(ObjectClass *klass, void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
>
> + dc->props = virtio_s390_properties;
> dc->realize = s390_virtio_busdev_realize;
> dc->bus_type = TYPE_S390_VIRTIO_BUS;
> dc->reset = s390_virtio_busdev_reset;
> @@ -651,7 +650,6 @@ static const TypeInfo virtio_s390_device_info = {
> };
>
> static Property s390_virtio_scsi_properties[] = {
> - DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features),
> DEFINE_VIRTIO_SCSI_FEATURES(VirtIOS390Device, host_features),
> DEFINE_PROP_END_OF_LIST(),
> };
> @@ -675,18 +673,12 @@ static const TypeInfo s390_virtio_scsi = {
> };
>
> #ifdef CONFIG_VHOST_SCSI
> -static Property s390_vhost_scsi_properties[] = {
> - DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features),
> - DEFINE_PROP_END_OF_LIST(),
> -};
> -
> static void s390_vhost_scsi_class_init(ObjectClass *klass, void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
> VirtIOS390DeviceClass *k = VIRTIO_S390_DEVICE_CLASS(klass);
>
> k->realize = s390_vhost_scsi_realize;
> - dc->props = s390_vhost_scsi_properties;
> set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
> }
>
>
--
Shannon
- [Qemu-devel] [PATCH 0/5] s390x: some virtio patches, Cornelia Huck, 2015/05/04
- [Qemu-devel] [PATCH 3/5] s390-virtio: clear {used, avail}_event_idx on reset as well, Cornelia Huck, 2015/05/04
- [Qemu-devel] [PATCH 2/5] s390-virtio: use common features, Cornelia Huck, 2015/05/04
- Re: [Qemu-devel] [PATCH 2/5] s390-virtio: use common features,
Shannon Zhao <=
- [Qemu-devel] [PATCH 1/5] s390-virtio: Accommodate guests using virtqueues too early, Cornelia Huck, 2015/05/04
- [Qemu-devel] [PATCH 5/5] virtio-ccw: implement ->device_plugged, Cornelia Huck, 2015/05/04
- [Qemu-devel] [PATCH 4/5] virtio-ccw: change realization sequence, Cornelia Huck, 2015/05/04