diff mbox

[RFC,5/6] Support "bootonceindex" property for virtio-net interfaces.

Message ID f8d5a6c541c733527c754f6695bc15080ee4c4f5.1489494746.git.janne.huttunen@nokia.com
State New
Headers show

Commit Message

Janne Huttunen March 14, 2017, 12:50 p.m. UTC
Signed-off-by: Janne Huttunen <janne.huttunen@nokia.com>
---
 hw/net/virtio-net.c    | 3 +++
 hw/virtio/virtio-pci.c | 2 ++
 include/net/net.h      | 1 +
 3 files changed, 6 insertions(+)
diff mbox

Patch

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)                            \