]> git.proxmox.com Git - qemu.git/blobdiff - hw/pci-hotplug.c
Support addr=... in option argument of -net nic
[qemu.git] / hw / pci-hotplug.c
index 4d49c29c4293508ce2d649a23225f4ac2a89741a..e2b14caafa4fc4078b3afc39f9ed72c05f5932a3 100644 (file)
 #include "virtio-blk.h"
 
 #if defined(TARGET_I386) || defined(TARGET_X86_64)
-static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon, PCIBus *pci_bus,
-                                       const char *opts)
+static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon, const char *opts)
 {
     int ret;
 
     ret = net_client_init(mon, "nic", opts);
     if (ret < 0)
         return NULL;
-    return pci_nic_init(pci_bus, &nd_table[ret], -1, "rtl8139");
+    if (nd_table[ret].devaddr) {
+        monitor_printf(mon, "Parameter addr not supported\n");
+        return NULL;
+    }
+    return pci_nic_init(&nd_table[ret], "rtl8139", NULL);
 }
 
 void drive_hot_add(Monitor *mon, const char *pci_addr, const char *opts)
@@ -149,7 +152,7 @@ void pci_device_hot_add(Monitor *mon, const char *pci_addr, const char *type,
     }
 
     if (strcmp(type, "nic") == 0)
-        dev = qemu_pci_hot_add_nic(mon, pci_bus, opts);
+        dev = qemu_pci_hot_add_nic(mon, opts);
     else if (strcmp(type, "storage") == 0)
         dev = qemu_pci_hot_add_storage(mon, pci_bus, opts);
     else