From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpQn2-0005rI-VZ for qemu-devel@nongnu.org; Mon, 04 May 2015 20:32:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YpQmz-000559-Mk for qemu-devel@nongnu.org; Mon, 04 May 2015 20:32:48 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:36318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpQmz-00054v-HK for qemu-devel@nongnu.org; Mon, 04 May 2015 20:32:45 -0400 Received: by pabsx10 with SMTP id sx10so175272448pab.3 for ; Mon, 04 May 2015 17:32:43 -0700 (PDT) Message-ID: <55480FA2.2030203@linaro.org> Date: Tue, 05 May 2015 08:32:34 +0800 From: Shannon Zhao MIME-Version: 1.0 References: <1430753300-25739-1-git-send-email-cornelia.huck@de.ibm.com> <1430753300-25739-3-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1430753300-25739-3-git-send-email-cornelia.huck@de.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/5] s390-virtio: use common features List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck , qemu-devel@nongnu.org Cc: borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, agraf@suse.de 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 > Signed-off-by: Cornelia Huck Reviewed-by: Shannon Zhao > --- > 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