[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 36/42] virtio-scsi: move qdev properties into virtio-
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 36/42] virtio-scsi: move qdev properties into virtio-scsi.c |
Date: |
Thu, 11 Jun 2015 14:00:45 +0200 |
From: Shannon Zhao <address@hidden>
As only one place in virtio-scsi.c uses DEFINE_VIRTIO_SCSI_PROPERTIES
and DEFINE_VIRTIO_SCSI_FEATURES, there is no need to expose them. Inline
them into virtio-scsi.c to avoid wrongly use.
Signed-off-by: Shannon Zhao <address@hidden>
Signed-off-by: Shannon Zhao <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Acked-by: Cornelia Huck <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
include/hw/virtio/virtio-scsi.h | 13 -------------
hw/scsi/virtio-scsi.c | 13 +++++++++++--
2 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h
index b42e7f1..088fe9f 100644
--- a/include/hw/virtio/virtio-scsi.h
+++ b/include/hw/virtio/virtio-scsi.h
@@ -141,19 +141,6 @@ typedef struct VirtIOSCSIReq {
} req;
} VirtIOSCSIReq;
-#define DEFINE_VIRTIO_SCSI_PROPERTIES(_state, _conf_field)
\
- DEFINE_PROP_UINT32("num_queues", _state, _conf_field.num_queues, 1),
\
- DEFINE_PROP_UINT32("max_sectors", _state, _conf_field.max_sectors,
0xFFFF),\
- DEFINE_PROP_UINT32("cmd_per_lun", _state, _conf_field.cmd_per_lun, 128)
-
-#define DEFINE_VIRTIO_SCSI_FEATURES(_state, _feature_field)
\
- DEFINE_PROP_BIT("any_layout", _state, _feature_field,
\
- VIRTIO_F_ANY_LAYOUT, true),
\
- DEFINE_PROP_BIT("hotplug", _state, _feature_field, VIRTIO_SCSI_F_HOTPLUG,
\
- true),
\
- DEFINE_PROP_BIT("param_change", _state, _feature_field,
\
- VIRTIO_SCSI_F_CHANGE, true)
-
typedef void (*HandleOutput)(VirtIODevice *, VirtQueue *);
void virtio_scsi_common_realize(DeviceState *dev, Error **errp,
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index b0dee29..f7d3c7c 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -948,8 +948,17 @@ static void virtio_scsi_device_unrealize(DeviceState *dev,
Error **errp)
}
static Property virtio_scsi_properties[] = {
- DEFINE_VIRTIO_SCSI_PROPERTIES(VirtIOSCSI, parent_obj.conf),
- DEFINE_VIRTIO_SCSI_FEATURES(VirtIOSCSI, host_features),
+ DEFINE_PROP_UINT32("num_queues", VirtIOSCSI, parent_obj.conf.num_queues,
1),
+ DEFINE_PROP_UINT32("max_sectors", VirtIOSCSI, parent_obj.conf.max_sectors,
+ 0xFFFF),
+ DEFINE_PROP_UINT32("cmd_per_lun", VirtIOSCSI, parent_obj.conf.cmd_per_lun,
+ 128),
+ DEFINE_PROP_BIT("any_layout", VirtIOSCSI, host_features,
+ VIRTIO_F_ANY_LAYOUT, true),
+ DEFINE_PROP_BIT("hotplug", VirtIOSCSI, host_features,
+ VIRTIO_SCSI_F_HOTPLUG, true),
+ DEFINE_PROP_BIT("param_change", VirtIOSCSI, host_features,
+ VIRTIO_SCSI_F_CHANGE, true),
DEFINE_PROP_END_OF_LIST(),
};
--
MST
- [Qemu-devel] [PULL 26/42] virtio-pci: add virtio_pci_modern_region_map(), (continued)
- [Qemu-devel] [PULL 26/42] virtio-pci: add virtio_pci_modern_region_map(), Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 27/42] virtio-pci: move virtio_pci_add_mem_cap call to virtio_pci_modern_region_map, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 29/42] virtio-pci: drop identical virtio_pci_cap, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 28/42] virtio-pci: move cap type to VirtIOPCIRegion, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 31/42] pci: add PCI_CLASS_INPUT_*, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 30/42] virtio-pci: fill VirtIOPCIRegions early., Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 32/42] virtio-input: core code & base class [pci], Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 34/42] virtio-net: move qdev properties into virtio-net.c, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 33/42] virtio-input: emulated devices [pci], Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 35/42] virtio-net.h: Remove unsed DEFINE_VIRTIO_NET_PROPERTIES, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 36/42] virtio-scsi: move qdev properties into virtio-scsi.c,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 37/42] virtio-rng: move qdev properties into virtio-rng.c, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 39/42] virtio-9p-device: move qdev properties into virtio-9p-device.c, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 38/42] virtio-serial-bus: move qdev properties into virtio-serial-bus.c, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 40/42] vhost-scsi: move qdev properties into vhost-scsi.c, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 41/42] i386/acpi-build: more traditional _UID and _HID for PXB root buses, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 42/42] i386/acpi-build: fix PXB workarounds for unsupported BIOSes, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 21/42] virtio-pci: correctly set host notifiers for modern bar, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 20/42] virtio-pci: make modern bar 64bit + prefetchable, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 19/42] virtio-pci: change & document virtio pci bar layout., Michael S. Tsirkin, 2015/06/11
- Re: [Qemu-devel] [PULL 00/42] pc, acpi, virtio, Peter Maydell, 2015/06/11