From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MllXz-0006Gz-Fc for qemu-devel@nongnu.org; Thu, 10 Sep 2009 11:26:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MllXt-0006DL-DV for qemu-devel@nongnu.org; Thu, 10 Sep 2009 11:26:53 -0400 Received: from [199.232.76.173] (port=40184 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MllXt-0006D0-4X for qemu-devel@nongnu.org; Thu, 10 Sep 2009 11:26:49 -0400 Received: from mail19.svc.cra.dublin.eircom.net ([159.134.118.218]:30679) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MllXq-00007x-QT for qemu-devel@nongnu.org; Thu, 10 Sep 2009 11:26:48 -0400 From: Mark McLoughlin Date: Thu, 10 Sep 2009 16:19:00 +0100 Message-Id: <1252595941-15196-19-git-send-email-markmc@redhat.com> In-Reply-To: <1252595941-15196-1-git-send-email-markmc@redhat.com> References: <1252595941-15196-1-git-send-email-markmc@redhat.com> Subject: [Qemu-devel] [PATCH 18/19] Port PCI NIC hotplug to QemuOpts List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Mark McLoughlin Signed-off-by: Mark McLoughlin --- 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