[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 10/27] eepro100: add bootindex to qom property
From: |
arei.gonglei |
Subject: |
[Qemu-devel] [PATCH v6 10/27] eepro100: add bootindex to qom property |
Date: |
Sat, 30 Aug 2014 18:00:10 +0800 |
From: Gonglei <address@hidden>
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-ooff-by: Gonglei <address@hidden>
---
hw/net/eepro100.c | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
index dcfaa48..5a29f20 100644
--- a/hw/net/eepro100.c
+++ b/hw/net/eepro100.c
@@ -1911,6 +1911,29 @@ static void eepro100_reset(DeviceState *dev)
add_boot_device_path(s->conf.bootindex, dev, "/address@hidden");
}
+static void eepro100_get_bootindex(Object *obj, Visitor *v, void *opaque,
+ const char *name, Error **errp)
+{
+ EEPRO100State *s = DO_UPCAST(EEPRO100State, dev, PCI_DEVICE(obj));
+
+ get_bootindex(&s->conf.bootindex, v, name, errp);
+}
+
+static void eepro100_set_bootindex(Object *obj, Visitor *v, void *opaque,
+ const char *name, Error **errp)
+{
+ EEPRO100State *s = DO_UPCAST(EEPRO100State, dev, PCI_DEVICE(obj));
+
+ set_bootindex(&s->conf.bootindex, v, name, errp);
+}
+
+static void eepro100_instance_init(Object *obj)
+{
+ object_property_add(obj, "bootindex", "int",
+ eepro100_get_bootindex,
+ eepro100_set_bootindex, NULL, NULL, NULL);
+}
+
static E100PCIDeviceInfo e100_devices[] = {
{
.name = "i82550",
@@ -2110,7 +2133,8 @@ static void eepro100_register_types(void)
type_info.parent = TYPE_PCI_DEVICE;
type_info.class_init = eepro100_class_init;
type_info.instance_size = sizeof(EEPRO100State);
-
+ type_info.instance_init = eepro100_instance_init;
+
type_register(&type_info);
}
}
--
1.7.12.4
- [Qemu-devel] [PATCH v6 00/27] modify boot order of guest, and take effect after rebooting, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 10/27] eepro100: add bootindex to qom property,
arei.gonglei <=
- [Qemu-devel] [PATCH v6 01/27] bootindex: add check bootindex function, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 04/27] bootindex: rework add_boot_device_path function, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 09/27] e1000: add bootindex to qom property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 05/27] bootindex: support to set a existent device's bootindex to -1, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 17/27] net: remove bootindex property from qdev to qom, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 25/27] virtio-blk: add bootindex to qom property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 21/27] redirect: remove bootindex property from qdev to qom, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 20/27] vfio: remove bootindex property from qdev to qom, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 26/27] block: remove bootindex property from qdev to qom, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 23/27] ide: add bootindex to qom property, arei.gonglei, 2014/08/30