[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 23/24] Port PCI NIC hotplug to QemuOpts
From: |
Mark McLoughlin |
Subject: |
[Qemu-devel] [PATCH 23/24] Port PCI NIC hotplug to QemuOpts |
Date: |
Wed, 23 Sep 2009 11:24:22 +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 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
- [Qemu-devel] [PATCH 00/19 v2] Port -net to QemuOpts, Mark McLoughlin, 2009/09/23
- [Qemu-devel] [PATCH 01/24] Use qemu_strdup() for NICInfo string fields, Mark McLoughlin, 2009/09/23
- [Qemu-devel] [PATCH 04/24] Correctly free nd structure, Mark McLoughlin, 2009/09/23
- [Qemu-devel] [PATCH 20/24] Clean up legacy code in net_client_init(), Mark McLoughlin, 2009/09/23
- [Qemu-devel] [PATCH 11/24] Add qemu_opts_validate() for post parsing validation, Mark McLoughlin, 2009/09/23
- [Qemu-devel] [PATCH 02/24] Don't assign a static string to NICInfo::model, Mark McLoughlin, 2009/09/23
- [Qemu-devel] [PATCH 03/24] Make NICInfo string fields non-const, Mark McLoughlin, 2009/09/23
- [Qemu-devel] [PATCH 10/24] Make qemu_opts_parse() handle empty strings, Mark McLoughlin, 2009/09/23
- [Qemu-devel] [PATCH 09/24] Remove double error message for -device option parsing, Mark McLoughlin, 2009/09/23
- [Qemu-devel] [PATCH 13/24] Add qemu_net_opts, Mark McLoughlin, 2009/09/23
- [Qemu-devel] [PATCH 23/24] Port PCI NIC hotplug to QemuOpts,
Mark McLoughlin <=
- [Qemu-devel] [PATCH 06/24] Fix coding style issue, Mark McLoughlin, 2009/09/23
- [Qemu-devel] [PATCH 08/24] Remove double error message in qemu_option_set(), Mark McLoughlin, 2009/09/23
- [Qemu-devel] [PATCH 22/24] Port usb net to QemuOpts, Mark McLoughlin, 2009/09/23
- [Qemu-devel] [PATCH 05/24] Use qemu_strdup() for VLANClientState string fields, Mark McLoughlin, 2009/09/23
- [Qemu-devel] [PATCH 17/24] Port -net socket to QemuOpts, Mark McLoughlin, 2009/09/23
- [Qemu-devel] [PATCH 15/24] Port -net user to QemuOpts, Mark McLoughlin, 2009/09/23
- [Qemu-devel] [PATCH 07/24] Remove bogus error message from qemu_opts_set(), Mark McLoughlin, 2009/09/23
- [Qemu-devel] [PATCH 16/24] Port -net tap to QemuOpts, Mark McLoughlin, 2009/09/23
- [Qemu-devel] [PATCH 21/24] Port host_net_add monitor command to QemuOpts, Mark McLoughlin, 2009/09/23