Blame SOURCES/kvm-s390-virtio-use-common-features.patch

8be556
From 4cf3a794d51284138c2f2daa37f21a2bc0b023f6 Mon Sep 17 00:00:00 2001
8be556
From: Xiao Wang <jasowang@redhat.com>
8be556
Date: Tue, 7 Jul 2015 09:18:19 +0200
8be556
Subject: [PATCH 131/217] s390-virtio: use common features
8be556
8be556
Message-id: <1436260751-25015-17-git-send-email-jasowang@redhat.com>
8be556
Patchwork-id: 66791
8be556
O-Subject: [RHEL7.2 qemu-kvm-rhev PATCH V2 16/68] s390-virtio: use common features
8be556
Bugzilla: 1227343
8be556
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
8be556
RH-Acked-by: David Gibson <dgibson@redhat.com>
8be556
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
8be556
RH-Acked-by: Thomas Huth <thuth@redhat.com>
8be556
8be556
From: Cornelia Huck <cornelia.huck@de.ibm.com>
8be556
8be556
Notes: conflicts because there's also an merge conflict upstream:
8be556
       commit 0403b0f539f40a21da60409b825b4653b273ab39
8be556
       ("Merge remote-tracking branch 'remotes/mst/tags/for_upstream'
8be556
       into staging"). Fixing by squash the changes of upstream
8be556
       and quote the upstream comments for how to fix the conflict:
8be556
8be556
       [PMM: fixed conflict in s390_virtio_scsi_properties and
8be556
       s390_virtio_net_properties arrays; since the result of the
8be556
       two conflicting patches is to empty the property arrays
8be556
       completely, the conflict resolution is to remove them entirely.]
8be556
8be556
We used to avoid enabling event_idx for virtio-blk devices via
8be556
s390-virtio, but we now have a workaround in place for guests trying
8be556
to use the device before setting DRIVER_OK. Therefore, let's add
8be556
DEFINE_VIRTIO_COMMON_FEATURES to the base device so all devices get
8be556
those common features - and make s390-virtio use the same mechanism
8be556
as the other transports do.
8be556
8be556
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
8be556
Reviewed-by: Shannon Zhao <shannon.zhao@linaro.org>
8be556
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
8be556
(cherry picked from commit f50616a81b7f88a9adac16f3ea0236311a748eca)
8be556
Signed-off-by: Jason Wang <jasowang@redhat.com>
8be556
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
8be556
8be556
Conflicts:
8be556
	hw/s390x/s390-virtio-bus.c
8be556
---
8be556
 hw/s390x/s390-virtio-bus.c | 30 ++++++------------------------
8be556
 1 file changed, 6 insertions(+), 24 deletions(-)
8be556
8be556
diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
8be556
index bb25487..c10b002 100644
8be556
--- a/hw/s390x/s390-virtio-bus.c
8be556
+++ b/hw/s390x/s390-virtio-bus.c
8be556
@@ -543,18 +543,12 @@ static void virtio_s390_device_plugged(DeviceState *d, Error **errp)
8be556
 
8be556
 /**************** S390 Virtio Bus Device Descriptions *******************/
8be556
 
8be556
-static Property s390_virtio_net_properties[] = {
8be556
-    DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features),
8be556
-    DEFINE_PROP_END_OF_LIST(),
8be556
-};
8be556
-
8be556
 static void s390_virtio_net_class_init(ObjectClass *klass, void *data)
8be556
 {
8be556
     DeviceClass *dc = DEVICE_CLASS(klass);
8be556
     VirtIOS390DeviceClass *k = VIRTIO_S390_DEVICE_CLASS(klass);
8be556
 
8be556
     k->realize = s390_virtio_net_realize;
8be556
-    dc->props = s390_virtio_net_properties;
8be556
     set_bit(DEVICE_CATEGORY_NETWORK, dc->categories);
8be556
 }
8be556
 
8be556
@@ -605,18 +599,12 @@ static const TypeInfo s390_virtio_serial = {
8be556
     .class_init    = s390_virtio_serial_class_init,
8be556
 };
8be556
 
8be556
-static Property s390_virtio_rng_properties[] = {
8be556
-    DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features),
8be556
-    DEFINE_PROP_END_OF_LIST(),
8be556
-};
8be556
-
8be556
 static void s390_virtio_rng_class_init(ObjectClass *klass, void *data)
8be556
 {
8be556
     DeviceClass *dc = DEVICE_CLASS(klass);
8be556
     VirtIOS390DeviceClass *k = VIRTIO_S390_DEVICE_CLASS(klass);
8be556
 
8be556
     k->realize = s390_virtio_rng_realize;
8be556
-    dc->props = s390_virtio_rng_properties;
8be556
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
8be556
 }
8be556
 
8be556
@@ -645,10 +633,16 @@ static void s390_virtio_busdev_reset(DeviceState *dev)
8be556
     virtio_reset(_dev->vdev);
8be556
 }
8be556
 
8be556
+static Property virtio_s390_properties[] = {
8be556
+    DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features),
8be556
+    DEFINE_PROP_END_OF_LIST(),
8be556
+};
8be556
+
8be556
 static void virtio_s390_device_class_init(ObjectClass *klass, void *data)
8be556
 {
8be556
     DeviceClass *dc = DEVICE_CLASS(klass);
8be556
 
8be556
+    dc->props = virtio_s390_properties;
8be556
     dc->realize = s390_virtio_busdev_realize;
8be556
     dc->bus_type = TYPE_S390_VIRTIO_BUS;
8be556
     dc->reset = s390_virtio_busdev_reset;
8be556
@@ -663,18 +657,12 @@ static const TypeInfo virtio_s390_device_info = {
8be556
     .abstract = true,
8be556
 };
8be556
 
8be556
-static Property s390_virtio_scsi_properties[] = {
8be556
-    DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features),
8be556
-    DEFINE_PROP_END_OF_LIST(),
8be556
-};
8be556
-
8be556
 static void s390_virtio_scsi_class_init(ObjectClass *klass, void *data)
8be556
 {
8be556
     DeviceClass *dc = DEVICE_CLASS(klass);
8be556
     VirtIOS390DeviceClass *k = VIRTIO_S390_DEVICE_CLASS(klass);
8be556
 
8be556
     k->realize = s390_virtio_scsi_realize;
8be556
-    dc->props = s390_virtio_scsi_properties;
8be556
     set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
8be556
 }
8be556
 
8be556
@@ -687,18 +675,12 @@ static const TypeInfo s390_virtio_scsi = {
8be556
 };
8be556
 
8be556
 #ifdef CONFIG_VHOST_SCSI
8be556
-static Property s390_vhost_scsi_properties[] = {
8be556
-    DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features),
8be556
-    DEFINE_PROP_END_OF_LIST(),
8be556
-};
8be556
-
8be556
 static void s390_vhost_scsi_class_init(ObjectClass *klass, void *data)
8be556
 {
8be556
     DeviceClass *dc = DEVICE_CLASS(klass);
8be556
     VirtIOS390DeviceClass *k = VIRTIO_S390_DEVICE_CLASS(klass);
8be556
 
8be556
     k->realize = s390_vhost_scsi_realize;
8be556
-    dc->props = s390_vhost_scsi_properties;
8be556
     set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
8be556
 }
8be556
 
8be556
-- 
8be556
1.8.3.1
8be556