From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqP2t-0003p4-Ut for qemu-devel@nongnu.org; Wed, 23 Sep 2009 06:26:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqP2k-0003iT-HZ for qemu-devel@nongnu.org; Wed, 23 Sep 2009 06:25:55 -0400 Received: from [199.232.76.173] (port=37821 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqP2i-0003hX-KZ for qemu-devel@nongnu.org; Wed, 23 Sep 2009 06:25:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15202) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MqP2h-0001Vx-4Z for qemu-devel@nongnu.org; Wed, 23 Sep 2009 06:25:47 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8NAPkg1004008 for ; Wed, 23 Sep 2009 06:25:46 -0400 From: Mark McLoughlin Date: Wed, 23 Sep 2009 11:24:22 +0100 Message-Id: <1253701463-3134-24-git-send-email-markmc@redhat.com> In-Reply-To: <1253701463-3134-1-git-send-email-markmc@redhat.com> References: <1253701463-3134-1-git-send-email-markmc@redhat.com> Subject: [Qemu-devel] [PATCH 23/24] 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 f3dc421..4905157 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