提交 c59c7ea9 编写于 作者: M Mark McLoughlin 提交者: Anthony Liguori

Port PCI NIC hotplug to QemuOpts

Signed-off-by: NMark McLoughlin <markmc@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 13cf8f21
...@@ -32,14 +32,26 @@ ...@@ -32,14 +32,26 @@
#include "block_int.h" #include "block_int.h"
#include "scsi-disk.h" #include "scsi-disk.h"
#include "virtio-blk.h" #include "virtio-blk.h"
#include "qemu-config.h"
#if defined(TARGET_I386) || defined(TARGET_X86_64) #if defined(TARGET_I386) || defined(TARGET_X86_64)
static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon, 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; 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) if (ret < 0)
return NULL; return NULL;
if (nd_table[ret].devaddr) { if (nd_table[ret].devaddr) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册