summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGonglei <arei.gonglei@huawei.com>2014-10-07 16:00:27 +0800
committerGerd Hoffmann <kraxel@redhat.com>2014-10-15 09:52:55 +0200
commit81782b6a7874c7f6e69d9d95747e477c4c17ceeb (patch)
tree89f197cccfada97cd65c4cbf9b3ad4fdd54d7b74 /hw
parent295857994c834473f0f28ac33b50f97ca8e61199 (diff)
downloadqemu-81782b6a7874c7f6e69d9d95747e477c4c17ceeb.tar.gz
isa-fdc: remove bootindexA/B property from qdev to qom
Remove bootindexA/B form qdev property to qom, 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/block/fdc.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 6c86a6b59e..9f9484cd17 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -2291,8 +2291,6 @@ static Property isa_fdc_properties[] = {
DEFINE_PROP_UINT32("dma", FDCtrlISABus, dma, 2),
DEFINE_PROP_DRIVE("driveA", FDCtrlISABus, state.drives[0].bs),
DEFINE_PROP_DRIVE("driveB", FDCtrlISABus, state.drives[1].bs),
- DEFINE_PROP_INT32("bootindexA", FDCtrlISABus, bootindexA, -1),
- DEFINE_PROP_INT32("bootindexB", FDCtrlISABus, bootindexB, -1),
DEFINE_PROP_BIT("check_media_rate", FDCtrlISABus, state.check_media_rate,
0, true),
DEFINE_PROP_END_OF_LIST(),
@@ -2310,11 +2308,24 @@ static void isabus_fdc_class_init(ObjectClass *klass, void *data)
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
}
+static void isabus_fdc_instance_init(Object *obj)
+{
+ FDCtrlISABus *isa = ISA_FDC(obj);
+
+ device_add_bootindex_property(obj, &isa->bootindexA,
+ "bootindexA", "/floppy@0",
+ DEVICE(obj), NULL);
+ device_add_bootindex_property(obj, &isa->bootindexB,
+ "bootindexB", "/floppy@1",
+ DEVICE(obj), NULL);
+}
+
static const TypeInfo isa_fdc_info = {
.name = TYPE_ISA_FDC,
.parent = TYPE_ISA_DEVICE,
.instance_size = sizeof(FDCtrlISABus),
.class_init = isabus_fdc_class_init,
+ .instance_init = isabus_fdc_instance_init,
};
static const VMStateDescription vmstate_sysbus_fdc ={