qemu-devel
[Top][All Lists]
Advanced

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

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


From: arei.gonglei
Subject: [Qemu-devel] [PATCH v7 17/28] net: remove bootindex property from qdev to qom
Date: Fri, 5 Sep 2014 16:37:25 +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 0edbfa6..2e5dc41 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -1627,6 +1627,7 @@ static void e1000_instance_init(Object *obj)
     device_add_bootindex_property(obj, &n->conf.bootindex,
                                   "bootindex", "/address@hidden",
                                   DEVICE(n), NULL);
+    object_property_set_int(obj, -1, "bootindex", NULL);
 }
 
 static const TypeInfo e1000_base_info = {
diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
index fb9c944..cc79f09 100644
--- a/hw/net/eepro100.c
+++ b/hw/net/eepro100.c
@@ -1912,6 +1912,7 @@ static void eepro100_instance_init(Object *obj)
     device_add_bootindex_property(obj, &s->conf.bootindex,
                                   "bootindex", "/address@hidden",
                                   DEVICE(s), 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 a1c49f1..4972b01 100644
--- a/hw/net/lance.c
+++ b/hw/net/lance.c
@@ -152,6 +152,7 @@ static void lance_instance_init(Object *obj)
     device_add_bootindex_property(obj, &s->conf.bootindex,
                                   "bootindex", "/address@hidden",
                                   DEVICE(obj), 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 62b86af..6d31555 100644
--- a/hw/net/ne2000.c
+++ b/hw/net/ne2000.c
@@ -761,6 +761,7 @@ static void ne2000_instance_init(Object *obj)
     device_add_bootindex_property(obj, &s->c.bootindex,
                                   "bootindex", "/address@hidden",
                                   &pci_dev->qdev, 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 fb5f5d6..55f906d 100644
--- a/hw/net/pcnet-pci.c
+++ b/hw/net/pcnet-pci.c
@@ -353,6 +353,7 @@ static void pcnet_instance_init(Object *obj)
     device_add_bootindex_property(obj, &s->conf.bootindex,
                                   "bootindex", "/address@hidden",
                                   DEVICE(obj), 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 138a03a..d921ebd 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -3550,6 +3550,7 @@ static void rtl8139_instance_init(Object *obj)
     device_add_bootindex_property(obj, &s->conf.bootindex,
                                   "bootindex", "/address@hidden",
                                   DEVICE(obj), 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 c3eb99a..c8b0978 100644
--- a/hw/net/spapr_llan.c
+++ b/hw/net/spapr_llan.c
@@ -226,6 +226,7 @@ static void spapr_vlan_instance_init(Object *obj)
     device_add_bootindex_property(obj, &dev->nicconf.bootindex,
                                   "bootindex", "",
                                   DEVICE(dev), 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 f5f6bf7..3e6d3fa 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1719,6 +1719,7 @@ static void virtio_net_instance_init(Object *obj)
     device_add_bootindex_property(obj, &n->nic_conf.bootindex,
                                   "bootindex", "/address@hidden",
                                   DEVICE(n), 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 88e9d9c..56b22f3 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -2183,6 +2183,7 @@ static void vmxnet3_instance_init(Object *obj)
     device_add_bootindex_property(obj, &s->conf.bootindex,
                                   "bootindex", "/address@hidden",
                                   DEVICE(obj), NULL);
+    object_property_set_int(obj, -1, "bootindex", NULL);
 }
 
 static void vmxnet3_pci_uninit(PCIDevice *pci_dev)
diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c
index 0dd4df7..f110ea7 100644
--- a/hw/usb/dev-network.c
+++ b/hw/usb/dev-network.c
@@ -1384,6 +1384,7 @@ static void usb_net_instance_init(Object *obj)
     device_add_bootindex_property(obj, &s->conf.bootindex,
                                   "bootindex", "/address@hidden",
                                   &dev->qdev, 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 0779d28..cb3212f 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1462,6 +1462,7 @@ static void virtio_net_pci_instance_init(Object *obj)
     device_add_bootindex_property(obj, &n->nic_conf.bootindex,
                                   "bootindex", "/address@hidden",
                                   DEVICE(n), 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]