qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 18/19] Port PCI NIC hotplug to QemuOpts


From: Mark McLoughlin
Subject: [Qemu-devel] [PATCH 18/19] Port PCI NIC hotplug to QemuOpts
Date: Thu, 10 Sep 2009 16:19:00 +0100

Signed-off-by: Mark McLoughlin <address@hidden>
---
 hw/pci-hotplug.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c
index 5348dd1..930a3eb 100644
--- a/hw/pci-hotplug.c
+++ b/hw/pci-hotplug.c
@@ -32,14 +32,26 @@
 #include "block_int.h"
 #include "scsi-disk.h"
 #include "virtio-blk.h"
+#include "qemu-config.h"
 
 #if defined(TARGET_I386) || defined(TARGET_X86_64)
 static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon,
-                                       const char *devaddr, const char *opts)
+                                       const char *devaddr,
+                                       const char *opts_str)
 {
+    QemuOpts *opts;
     int ret;
 
-    ret = net_client_init(mon, "nic", opts);
+    opts = qemu_opts_parse(&qemu_net_opts, opts_str ? opts_str : "", NULL);
+    if (!opts) {
+        monitor_printf(mon, "parsing network options '%s' failed\n",
+                       opts_str ? opts_str : "");
+        return NULL;
+    }
+
+    qemu_opt_set(opts, "type", "nic");
+
+    ret = net_client_init_from_opts(mon, opts);
     if (ret < 0)
         return NULL;
     if (nd_table[ret].devaddr) {
-- 
1.6.2.5





reply via email to

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