[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 22/27] isa-fdc: remove bootindexA/B property from
From: |
arei.gonglei |
Subject: |
[Qemu-devel] [PATCH v6 22/27] isa-fdc: remove bootindexA/B property from qdev to qom |
Date: |
Sat, 30 Aug 2014 18:00:22 +0800 |
From: Gonglei <address@hidden>
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 <address@hidden>
---
hw/block/fdc.c | 47 +++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 45 insertions(+), 2 deletions(-)
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 8add4a1..169a8f0 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -2217,8 +2217,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(),
@@ -2236,11 +2234,56 @@ static void isabus_fdc_class_init(ObjectClass *klass,
void *data)
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
}
+static void isabus_fdc_get_bootindexA(Object *obj, Visitor *v, void *opaque,
+ const char *name, Error **errp)
+{
+ FDCtrlISABus *isa = ISA_FDC(obj);
+
+ get_bootindex(&isa->bootindexA, v, name, errp);
+}
+
+static void isabus_fdc_set_bootindexA(Object *obj, Visitor *v, void *opaque,
+ const char *name, Error **errp)
+{
+ FDCtrlISABus *isa = ISA_FDC(obj);
+
+ set_bootindex(&isa->bootindexA, v, name, errp);
+}
+
+static void isabus_fdc_get_bootindexB(Object *obj, Visitor *v, void *opaque,
+ const char *name, Error **errp)
+{
+ FDCtrlISABus *isa = ISA_FDC(obj);
+
+ get_bootindex(&isa->bootindexB, v, name, errp);
+}
+
+static void isabus_fdc_set_bootindexB(Object *obj, Visitor *v, void *opaque,
+ const char *name, Error **errp)
+{
+ FDCtrlISABus *isa = ISA_FDC(obj);
+
+ set_bootindex(&isa->bootindexB, v, name, errp);
+}
+
+static void isabus_fdc_instance_init(Object *obj)
+{
+ object_property_add(obj, "bootindexA", "int",
+ isabus_fdc_get_bootindexA,
+ isabus_fdc_set_bootindexA, NULL, NULL, NULL);
+ object_property_add(obj, "bootindexB", "int",
+ isabus_fdc_get_bootindexB,
+ isabus_fdc_set_bootindexB, NULL, NULL, NULL);
+ object_property_set_int(obj, -1, "bootindexA", NULL);
+ object_property_set_int(obj, -1, "bootindexB", 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 ={
--
1.7.12.4
- [Qemu-devel] [PATCH v6 23/27] ide: add bootindex to qom property, (continued)
- [Qemu-devel] [PATCH v6 23/27] ide: add bootindex to qom property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 08/27] virtio-net: add bootindex to qom property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 24/27] scsi: add bootindex to qom property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 07/27] vl.c: add setter/getter functions for bootindex property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 19/27] pci-assign: remove bootindex property from qdev to qom, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 18/27] host-libusb: remove bootindex property from qdev to qom, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 27/27] bootindex: delete bootindex when device is removed, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 14/27] spapr_lian: add bootindex to qom property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 03/27] fw_cfg: add fw_cfg_machine_reset function, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 12/27] pcnet: add bootindex to qom property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 22/27] isa-fdc: remove bootindexA/B property from qdev to qom,
arei.gonglei <=
- [Qemu-devel] [PATCH v6 16/27] usb-net: add bootindex to qom property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 15/27] vmxnet3: add bootindex to qom property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 11/27] ne2000: add bootindex to qom property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 06/27] bootindex: move setting bootindex on reset() instead of realize/init(), arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 02/27] bootindex: add del_boot_device_path function, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 13/27] rtl8139: add bootindex to qom property, arei.gonglei, 2014/08/30