[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/7] monitor: Improve host_net_add
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH 5/7] monitor: Improve host_net_add |
Date: |
Tue, 14 Apr 2009 19:29:55 +0200 |
User-agent: |
StGIT/0.14.2 |
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 <address@hidden>
---
monitor.c | 4 ++--
net.c | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/monitor.c b/monitor.c
index e764b5d..d9f84a7 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1730,8 +1730,8 @@ static const mon_cmd_t mon_cmds[] = {
"add drive to PCI storage controller"
},
{ "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" },
{ "pci_del", "s", pci_device_hot_remove,
"pci_addr=[[<domain>:]<bus>:]<slot>", "hot remove PCI device" },
- { "host_net_add", "ss", net_host_device_add,
- "[tap,user,socket,vde] options", "add host VLAN client" },
+ { "host_net_add", "ss?", net_host_device_add,
+ "tap|user|socket|vde [options]", "add host VLAN client" },
{ "host_net_remove", "is", net_host_device_remove,
"vlan_id name", "remove host VLAN client" },
#endif
diff --git a/net.c b/net.c
index 0486f7c..e812eb8 100644
--- a/net.c
+++ b/net.c
@@ -1859,7 +1859,9 @@ void net_host_device_add(Monitor *mon, const char
*device, const char *opts)
monitor_printf(mon, "invalid host network device %s\n", device);
return;
}
- net_client_init(device, opts);
+ if (net_client_init(device, opts ? : "") < 0) {
+ monitor_printf(mon, "adding host network device %s failed\n", device);
+ }
}
void net_host_device_remove(Monitor *mon, int vlan_id, const char *device)
[Qemu-devel] [PATCH 3/7] net: Check device passed to host_net_remove, Jan Kiszka, 2009/04/14
[Qemu-devel] [PATCH 7/7] slirp: Handle DHCP requests for specific IP, Jan Kiszka, 2009/04/14
[Qemu-devel] [PATCH 5/7] monitor: Improve host_net_add,
Jan Kiszka <=
[Qemu-devel] [PATCH 6/7] net: Add support for capturing VLANs, Jan Kiszka, 2009/04/14