qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v6 17/27] net: remove bootindex property from qdev t


From: arei.gonglei
Subject: [Qemu-devel] [PATCH v6 17/27] net: remove bootindex property from qdev to qom
Date: Sat, 30 Aug 2014 18:00:17 +0800

From: Gonglei <address@hidden>

Remove bootindex form qdev property to qom, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Meanwhile set the initial value of bootindex to -1.

Signed-off-by: Gonglei <address@hidden>
---
 hw/net/e1000.c         | 1 +
 hw/net/eepro100.c      | 1 +
 hw/net/lance.c         | 1 +
 hw/net/ne2000.c        | 1 +
 hw/net/pcnet-pci.c     | 1 +
 hw/net/rtl8139.c       | 1 +
 hw/net/spapr_llan.c    | 1 +
 hw/net/virtio-net.c    | 1 +
 hw/net/vmxnet3.c       | 1 +
 hw/usb/dev-network.c   | 1 +
 hw/virtio/virtio-pci.c | 1 +
 include/net/net.h      | 4 +---
 12 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index ed87b74..d1d66c5 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -1605,6 +1605,7 @@ static void e1000_instance_init(Object *obj)
     object_property_add(obj, "bootindex", "int",
                         e1000_get_bootindex,
                         e1000_set_bootindex, NULL, NULL, NULL);
+    object_property_set_int(obj, -1, "bootindex", NULL);
 }
 
 static Property e1000_properties[] = {
diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
index 5a29f20..503f04f 100644
--- a/hw/net/eepro100.c
+++ b/hw/net/eepro100.c
@@ -1932,6 +1932,7 @@ static void eepro100_instance_init(Object *obj)
     object_property_add(obj, "bootindex", "int",
                         eepro100_get_bootindex,
                         eepro100_set_bootindex, NULL, NULL, NULL);
+    object_property_set_int(obj, -1, "bootindex", NULL);
 }
 
 static E100PCIDeviceInfo e100_devices[] = {
diff --git a/hw/net/lance.c b/hw/net/lance.c
index 3071b3f..4ca0340 100644
--- a/hw/net/lance.c
+++ b/hw/net/lance.c
@@ -168,6 +168,7 @@ static void lance_instance_init(Object *obj)
     object_property_add(obj, "bootindex", "int",
                         lance_get_bootindex,
                         lance_set_bootindex, NULL, NULL, NULL);
+    object_property_set_int(obj, -1, "bootindex", NULL);
 }
 
 static Property lance_properties[] = {
diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
index 3ddb494..ecdb663 100644
--- a/hw/net/ne2000.c
+++ b/hw/net/ne2000.c
@@ -781,6 +781,7 @@ static void ne2000_instance_init(Object *obj)
     object_property_add(obj, "bootindex", "int",
                         ne2000_get_bootindex,
                         ne2000_set_bootindex, NULL, NULL, NULL);
+    object_property_set_int(obj, -1, "bootindex", NULL);
 }
 
 static Property ne2000_properties[] = {
diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c
index ca744c8..fb00f4f 100644
--- a/hw/net/pcnet-pci.c
+++ b/hw/net/pcnet-pci.c
@@ -371,6 +371,7 @@ static void pcnet_instance_init(Object *obj)
     object_property_add(obj, "bootindex", "int",
                         pcnet_get_bootindex,
                         pcnet_set_bootindex, NULL, NULL, NULL);
+    object_property_set_int(obj, -1, "bootindex", NULL);
 }
 
 static Property pcnet_properties[] = {
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index eba60d1..59e8729 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -3564,6 +3564,7 @@ static void rtl8139_instance_init(Object *obj)
     object_property_add(obj, "bootindex", "int",
                         rtl8139_get_bootindex,
                         rtl8139_set_bootindex, NULL, NULL, NULL);
+    object_property_set_int(obj, -1, "bootindex", NULL);
 }
 
 static Property rtl8139_properties[] = {
diff --git a/hw/net/spapr_llan.c b/hw/net/spapr_llan.c
index 773404a..856f320 100644
--- a/hw/net/spapr_llan.c
+++ b/hw/net/spapr_llan.c
@@ -240,6 +240,7 @@ static void spapr_vlan_instance_init(Object *obj)
     object_property_add(obj, "bootindex", "int",
                         spapr_vlan_get_bootindex,
                         spapr_vlan_set_bootindex, NULL, NULL, NULL);
+    object_property_set_int(obj, -1, "bootindex", NULL);
 }
 
 void spapr_vlan_create(VIOsPAPRBus *bus, NICInfo *nd)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 8b409ad..7dce688 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1714,6 +1714,7 @@ static void virtio_net_instance_init(Object *obj)
     object_property_add(obj, "bootindex", "int",
                         virtio_net_get_bootindex,
                         virtio_net_set_bootindex, NULL, NULL, NULL);
+    object_property_set_int(obj, -1, "bootindex", NULL);
 }
 
 static Property virtio_net_properties[] = {
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index a9ed593..e6f10bb 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -2224,6 +2224,7 @@ static void vmxnet3_instance_init(Object *obj)
     object_property_add(obj, "bootindex", "int",
                         vmxnet3_get_bootindex,
                         vmxnet3_set_bootindex, NULL, NULL, NULL);
+    object_property_set_int(obj, -1, "bootindex", NULL);
 }
 
 static bool vmxnet3_mc_list_needed(void *opaque)
diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c
index 7a34368..a85866b 100644
--- a/hw/usb/dev-network.c
+++ b/hw/usb/dev-network.c
@@ -1399,6 +1399,7 @@ static void usb_net_instance_init(Object *obj)
     object_property_add(obj, "bootindex", "int",
                         usb_net_get_bootindex,
                         usb_net_set_bootindex, NULL, NULL, NULL);
+    object_property_set_int(obj, -1, "bootindex", NULL);
 }
 
 static USBDevice *usb_net_init(USBBus *bus, const char *cmdline)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index ca8bdfd..704c83b 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1478,6 +1478,7 @@ static void virtio_net_pci_instance_init(Object *obj)
     object_property_add(obj, "bootindex", "int",
                         virtio_net_pci_get_bootindex,
                         virtio_net_pci_set_bootindex, NULL, NULL, NULL);
+    object_property_set_int(obj, -1, "bootindex", NULL);
 }
 
 static const TypeInfo virtio_net_pci_info = {
diff --git a/include/net/net.h b/include/net/net.h
index ed594f9..e482550 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -36,9 +36,7 @@ typedef struct NICConf {
 #define DEFINE_NIC_PROPERTIES(_state, _conf)                            \
     DEFINE_PROP_MACADDR("mac",   _state, _conf.macaddr),                \
     DEFINE_PROP_VLAN("vlan",     _state, _conf.peers),                   \
-    DEFINE_PROP_NETDEV("netdev", _state, _conf.peers),                   \
-    DEFINE_PROP_INT32("bootindex", _state, _conf.bootindex, -1)
-
+    DEFINE_PROP_NETDEV("netdev", _state, _conf.peers)
 
 /* Net clients */
 
-- 
1.7.12.4





reply via email to

[Prev in Thread] Current Thread [Next in Thread]