diff options
author | Mark McLoughlin <markmc@redhat.com> | 2009-10-06 12:17:15 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-10-06 14:36:13 -0500 |
commit | c59c7ea94796a4fce2fe79b8f9aa3628dc2e0b2a (patch) | |
tree | d69adb1520776ed0236ac5d3ab2570b0ebe96d0d | |
parent | 13cf8f2129677189c03009bc05995d461a93da6a (diff) |
Port PCI NIC hotplug to QemuOpts
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r-- | 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 44f6a2f9bb..7af4f29e7d 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) { |