aboutsummaryrefslogtreecommitdiff
path: root/hw/net/lance.c
diff options
context:
space:
mode:
authorGonglei <arei.gonglei@huawei.com>2014-10-07 16:00:16 +0800
committerGerd Hoffmann <kraxel@redhat.com>2014-10-15 09:52:54 +0200
commitea3b3511cda0b68100b9633223540f5d5ca69078 (patch)
tree0a6de00fc0ab2c847c7ce55d9ab91e9ae742e441 /hw/net/lance.c
parent6cb0851d628ffb84088e1dbdb70098320a5c0894 (diff)
downloadqemu-ea3b3511cda0b68100b9633223540f5d5ca69078.zip
qemu-ea3b3511cda0b68100b9633223540f5d5ca69078.tar.gz
qemu-ea3b3511cda0b68100b9633223540f5d5ca69078.tar.bz2
pcnet: 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/net/lance.c')
-rw-r--r--hw/net/lance.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/net/lance.c b/hw/net/lance.c
index 7811a9e..a1c49f1 100644
--- a/hw/net/lance.c
+++ b/hw/net/lance.c
@@ -42,6 +42,7 @@
#include "hw/sparc/sun4m.h"
#include "pcnet.h"
#include "trace.h"
+#include "sysemu/sysemu.h"
#define TYPE_LANCE "lance"
#define SYSBUS_PCNET(obj) \
@@ -143,6 +144,16 @@ static void lance_reset(DeviceState *dev)
pcnet_h_reset(&d->state);
}
+static void lance_instance_init(Object *obj)
+{
+ SysBusPCNetState *d = SYSBUS_PCNET(obj);
+ PCNetState *s = &d->state;
+
+ device_add_bootindex_property(obj, &s->conf.bootindex,
+ "bootindex", "/ethernet-phy@0",
+ DEVICE(obj), NULL);
+}
+
static Property lance_properties[] = {
DEFINE_PROP_PTR("dma", SysBusPCNetState, state.dma_opaque),
DEFINE_NIC_PROPERTIES(SysBusPCNetState, state.conf),
@@ -169,6 +180,7 @@ static const TypeInfo lance_info = {
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(SysBusPCNetState),
.class_init = lance_class_init,
+ .instance_init = lance_instance_init,
};
static void lance_register_types(void)