Commit 5c8be678a912e3ce2a5289bfec981f98d3dd495f
1 parent
bb9ea79e
monitor: Improve host_net_add (Jan Kiszka)
Fix the documentation of the host_net_add monitor command and allow the user to pass no options at all. Moreover, inform the user on the monitor terminal if a request failed. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7201 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
5 additions
and
3 deletions
monitor.c
... | ... | @@ -1730,8 +1730,8 @@ static const mon_cmd_t mon_cmds[] = { |
1730 | 1730 | "add drive to PCI storage controller" }, |
1731 | 1731 | { "pci_add", "sss", pci_device_hot_add, "pci_addr=auto|[[<domain>:]<bus>:]<slot> nic|storage [[vlan=n][,macaddr=addr][,model=type]] [file=file][,if=type][,bus=nr]...", "hot-add PCI device" }, |
1732 | 1732 | { "pci_del", "s", pci_device_hot_remove, "pci_addr=[[<domain>:]<bus>:]<slot>", "hot remove PCI device" }, |
1733 | - { "host_net_add", "ss", net_host_device_add, | |
1734 | - "[tap,user,socket,vde,dump] options", "add host VLAN client" }, | |
1733 | + { "host_net_add", "ss?", net_host_device_add, | |
1734 | + "tap|user|socket|vde|dump [options]", "add host VLAN client" }, | |
1735 | 1735 | { "host_net_remove", "is", net_host_device_remove, |
1736 | 1736 | "vlan_id name", "remove host VLAN client" }, |
1737 | 1737 | #endif | ... | ... |
net.c
... | ... | @@ -2042,7 +2042,9 @@ void net_host_device_add(Monitor *mon, const char *device, const char *opts) |
2042 | 2042 | monitor_printf(mon, "invalid host network device %s\n", device); |
2043 | 2043 | return; |
2044 | 2044 | } |
2045 | - net_client_init(device, opts); | |
2045 | + if (net_client_init(device, opts ? : "") < 0) { | |
2046 | + monitor_printf(mon, "adding host network device %s failed\n", device); | |
2047 | + } | |
2046 | 2048 | } |
2047 | 2049 | |
2048 | 2050 | void net_host_device_remove(Monitor *mon, int vlan_id, const char *device) | ... | ... |