From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mv8YR-0005Gw-S9 for qemu-devel@nongnu.org; Tue, 06 Oct 2009 07:50:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mv8YN-00059U-6l for qemu-devel@nongnu.org; Tue, 06 Oct 2009 07:50:07 -0400 Received: from [199.232.76.173] (port=38537 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mv8YM-000592-Qy for qemu-devel@nongnu.org; Tue, 06 Oct 2009 07:50:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47885) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mv8YM-000440-Dw for qemu-devel@nongnu.org; Tue, 06 Oct 2009 07:50:02 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n96BIrS1007483 for ; Tue, 6 Oct 2009 07:18:53 -0400 From: Mark McLoughlin Date: Tue, 6 Oct 2009 12:17:15 +0100 Message-Id: <1254827836-11021-26-git-send-email-markmc@redhat.com> In-Reply-To: <1254827783.2720.42.camel@blaa> References: <1254827783.2720.42.camel@blaa> Subject: [Qemu-devel] [PATCH] 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 f781386..b5d532d 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