Blame SOURCES/kvm-virtio-scsi-move-qdev-properties-into-virtio-scsi.c.patch

8be556
From 458e690ea8ea6657f8cd56758ce7140731dea5f6 Mon Sep 17 00:00:00 2001
8be556
From: Xiao Wang <jasowang@redhat.com>
8be556
Date: Tue, 7 Jul 2015 09:19:01 +0200
8be556
Subject: [PATCH 173/217] virtio-scsi: move qdev properties into virtio-scsi.c
8be556
8be556
Message-id: <1436260751-25015-59-git-send-email-jasowang@redhat.com>
8be556
Patchwork-id: 66834
8be556
O-Subject: [RHEL7.2 qemu-kvm-rhev PATCH V2 58/68] virtio-scsi: move qdev properties into virtio-scsi.c
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: Shannon Zhao <shannon.zhao@linaro.org>
8be556
8be556
As only one place in virtio-scsi.c uses DEFINE_VIRTIO_SCSI_PROPERTIES
8be556
and DEFINE_VIRTIO_SCSI_FEATURES, there is no need to expose them. Inline
8be556
them into virtio-scsi.c to avoid wrongly use.
8be556
8be556
Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
8be556
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
8be556
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
8be556
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
8be556
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
8be556
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
8be556
(cherry picked from commit 0c63237a90f37fffe8a8016f24f61bb228653e86)
8be556
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
8be556
---
8be556
 hw/scsi/virtio-scsi.c           | 13 +++++++++++--
8be556
 include/hw/virtio/virtio-scsi.h | 13 -------------
8be556
 2 files changed, 11 insertions(+), 15 deletions(-)
8be556
8be556
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
8be556
index b0dee29..f7d3c7c 100644
8be556
--- a/hw/scsi/virtio-scsi.c
8be556
+++ b/hw/scsi/virtio-scsi.c
8be556
@@ -948,8 +948,17 @@ static void virtio_scsi_device_unrealize(DeviceState *dev, Error **errp)
8be556
 }
8be556
 
8be556
 static Property virtio_scsi_properties[] = {
8be556
-    DEFINE_VIRTIO_SCSI_PROPERTIES(VirtIOSCSI, parent_obj.conf),
8be556
-    DEFINE_VIRTIO_SCSI_FEATURES(VirtIOSCSI, host_features),
8be556
+    DEFINE_PROP_UINT32("num_queues", VirtIOSCSI, parent_obj.conf.num_queues, 1),
8be556
+    DEFINE_PROP_UINT32("max_sectors", VirtIOSCSI, parent_obj.conf.max_sectors,
8be556
+                                                  0xFFFF),
8be556
+    DEFINE_PROP_UINT32("cmd_per_lun", VirtIOSCSI, parent_obj.conf.cmd_per_lun,
8be556
+                                                  128),
8be556
+    DEFINE_PROP_BIT("any_layout", VirtIOSCSI, host_features,
8be556
+                                              VIRTIO_F_ANY_LAYOUT, true),
8be556
+    DEFINE_PROP_BIT("hotplug", VirtIOSCSI, host_features,
8be556
+                                           VIRTIO_SCSI_F_HOTPLUG, true),
8be556
+    DEFINE_PROP_BIT("param_change", VirtIOSCSI, host_features,
8be556
+                                                VIRTIO_SCSI_F_CHANGE, true),
8be556
     DEFINE_PROP_END_OF_LIST(),
8be556
 };
8be556
 
8be556
diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h
8be556
index b42e7f1..088fe9f 100644
8be556
--- a/include/hw/virtio/virtio-scsi.h
8be556
+++ b/include/hw/virtio/virtio-scsi.h
8be556
@@ -141,19 +141,6 @@ typedef struct VirtIOSCSIReq {
8be556
     } req;
8be556
 } VirtIOSCSIReq;
8be556
 
8be556
-#define DEFINE_VIRTIO_SCSI_PROPERTIES(_state, _conf_field)                     \
8be556
-    DEFINE_PROP_UINT32("num_queues", _state, _conf_field.num_queues, 1),       \
8be556
-    DEFINE_PROP_UINT32("max_sectors", _state, _conf_field.max_sectors, 0xFFFF),\
8be556
-    DEFINE_PROP_UINT32("cmd_per_lun", _state, _conf_field.cmd_per_lun, 128)
8be556
-
8be556
-#define DEFINE_VIRTIO_SCSI_FEATURES(_state, _feature_field)                    \
8be556
-    DEFINE_PROP_BIT("any_layout", _state, _feature_field,                      \
8be556
-                    VIRTIO_F_ANY_LAYOUT, true),                                \
8be556
-    DEFINE_PROP_BIT("hotplug", _state, _feature_field, VIRTIO_SCSI_F_HOTPLUG,  \
8be556
-                                                       true),                  \
8be556
-    DEFINE_PROP_BIT("param_change", _state, _feature_field,                    \
8be556
-                                            VIRTIO_SCSI_F_CHANGE, true)
8be556
-
8be556
 typedef void (*HandleOutput)(VirtIODevice *, VirtQueue *);
8be556
 
8be556
 void virtio_scsi_common_realize(DeviceState *dev, Error **errp,
8be556
-- 
8be556
1.8.3.1
8be556