Signed-off-by: Janne Huttunen <[email protected]>
---
hw/net/virtio-net.c | 3 +++
hw/virtio/virtio-pci.c | 2 ++
include/net/net.h | 1 +
3 files changed, 6 insertions(+)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index c321680..928b60b 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -2016,6 +2016,9 @@ static void virtio_net_instance_init(Object *obj)
device_add_bootindex_property(obj, &n->nic_conf.bootindex,
"bootindex", "/ethernet-phy@0",
DEVICE(n), NULL);
+ device_add_bootonceindex_property(obj, &n->nic_conf.bootonceindex,
+ "bootonceindex", "/ethernet-phy@0",
+ DEVICE(n), NULL);
}
static void virtio_net_pre_save(void *opaque)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 5ce42af..abfa5bd 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -2322,6 +2322,8 @@ static void virtio_net_pci_instance_init(Object *obj)
TYPE_VIRTIO_NET);
object_property_add_alias(obj, "bootindex", OBJECT(&dev->vdev),
"bootindex", &error_abort);
+ object_property_add_alias(obj, "bootonceindex", OBJECT(&dev->vdev),
+ "bootonceindex", &error_abort);
}
static const TypeInfo virtio_net_pci_info = {
diff --git a/include/net/net.h b/include/net/net.h
index 99b28d5..de98b883 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -36,6 +36,7 @@ typedef struct NICConf {
MACAddr macaddr;
NICPeers peers;
int32_t bootindex;
+ int32_t bootonceindex;
} NICConf;
#define DEFINE_NIC_PROPERTIES(_state, _conf) \
--
2.7.4