From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lu50I-0005l0-JS for qemu-devel@nongnu.org; Wed, 15 Apr 2009 09:18:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lu50D-0005iS-TG for qemu-devel@nongnu.org; Wed, 15 Apr 2009 09:18:14 -0400 Received: from [199.232.76.173] (port=44437 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lu50D-0005iN-Fo for qemu-devel@nongnu.org; Wed, 15 Apr 2009 09:18:09 -0400 Received: from mx2.redhat.com ([66.187.237.31]:56875) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lu50D-0007eT-1N for qemu-devel@nongnu.org; Wed, 15 Apr 2009 09:18:09 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n3FDI8Do029380 for ; Wed, 15 Apr 2009 09:18:08 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n3FDI7LF005661 for ; Wed, 15 Apr 2009 09:18:07 -0400 Received: from [127.0.0.1] (file.rdu.redhat.com [10.11.255.147]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n3FDI6gp008234 for ; Wed, 15 Apr 2009 09:18:06 -0400 Subject: Re: [Qemu-devel] [PATCH 5/7] monitor: Improve host_net_add From: Mark McLoughlin In-Reply-To: <20090414172955.15035.54728.stgit@mchn012c.ww002.siemens.net> References: <20090414172954.15035.73053.stgit@mchn012c.ww002.siemens.net> <20090414172955.15035.54728.stgit@mchn012c.ww002.siemens.net> Content-Type: text/plain Date: Wed, 15 Apr 2009 14:09:57 +0100 Message-Id: <1239800997.4431.131.camel@blaa> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: Mark McLoughlin , qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Tue, 2009-04-14 at 19:29 +0200, Jan Kiszka wrote: > 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 > --- > > 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|[[:]:] 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=[[:]:]", "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); > + } > } Looks good to me. Acked-by: Mark McLoughlin Cheers, Mark.