Add support for .bootindex property in hv-net.
This results in a corresponding entry appearing in fw_cfg "bootorder".
In order to actually boot off a hv-net device (via PXE) the firmware
needs also a driver for it (either built-in or supplied via ROM).
Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
---
hw/net/hv-net.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/hw/net/hv-net.c b/hw/net/hv-net.c
index 614922c0fb..3d719458ea 100644
--- a/hw/net/hv-net.c
+++ b/hw/net/hv-net.c
@@ -1425,11 +1425,20 @@ static void hv_net_class_init(ObjectClass *klass, void *data)
vdc->chan_notify_cb = hv_net_notify_cb;
}
+static void hv_net_instance_init(Object *obj)
+{
+ HvNet *s = HV_NET(obj);
+ device_add_bootindex_property(obj, &s->conf.bootindex,
+ "bootindex", "/ethernet-phy@0",
+ DEVICE(obj), NULL);
+}
+
static const TypeInfo hv_net_type_info = {
.name = TYPE_HV_NET,
.parent = TYPE_VMBUS_DEVICE,
.instance_size = sizeof(HvNet),
.class_init = hv_net_class_init,
+ .instance_init = hv_net_instance_init,
};
static void hv_net_register_types(void)
--
2.14.3