summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGonglei <arei.gonglei@huawei.com>2014-10-07 16:00:28 +0800
committerGerd Hoffmann <kraxel@redhat.com>2014-10-15 09:52:55 +0200
commit44fb6337b9568ccb9f0d6dfb357eeb69f66d8527 (patch)
tree41dff80fa4aeb223c9e1a86d14a1e6f11c60bd29 /hw
parent81782b6a7874c7f6e69d9d95747e477c4c17ceeb (diff)
downloadqemu-44fb6337b9568ccb9f0d6dfb357eeb69f66d8527.tar.gz
scsi: add bootindex to qom property
Add a qom property with the same name 'bootindex', when we remove it form qdev property, things will continue to work just fine, and we can use qom features which are not supported by qdev property. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/scsi/scsi-bus.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
index 0f3e0395f5..59e8f90b96 100644
--- a/hw/scsi/scsi-bus.c
+++ b/hw/scsi/scsi-bus.c
@@ -2016,6 +2016,16 @@ static void scsi_device_class_init(ObjectClass *klass, void *data)
k->props = scsi_props;
}
+static void scsi_dev_instance_init(Object *obj)
+{
+ DeviceState *dev = DEVICE(obj);
+ SCSIDevice *s = DO_UPCAST(SCSIDevice, qdev, dev);
+
+ device_add_bootindex_property(obj, &s->conf.bootindex,
+ "bootindex", NULL,
+ &s->qdev, NULL);
+}
+
static const TypeInfo scsi_device_type_info = {
.name = TYPE_SCSI_DEVICE,
.parent = TYPE_DEVICE,
@@ -2023,6 +2033,7 @@ static const TypeInfo scsi_device_type_info = {
.abstract = true,
.class_size = sizeof(SCSIDeviceClass),
.class_init = scsi_device_class_init,
+ .instance_init = scsi_dev_instance_init,
};
static void scsi_register_types(void)