From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LyswS-0000Gd-4N for qemu-devel@nongnu.org; Tue, 28 Apr 2009 15:26:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LyswN-0000Cn-Et for qemu-devel@nongnu.org; Tue, 28 Apr 2009 15:26:07 -0400 Received: from [199.232.76.173] (port=46437 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LyswN-0000Ci-A9 for qemu-devel@nongnu.org; Tue, 28 Apr 2009 15:26:03 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:37160) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LyswM-0007HN-OW for qemu-devel@nongnu.org; Tue, 28 Apr 2009 15:26:03 -0400 Message-ID: <49F75846.7040600@web.de> Date: Tue, 28 Apr 2009 21:25:58 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <20090419100424.24240.51439.stgit@mchn012c.ww002.siemens.net> <20090419100425.24240.15130.stgit@mchn012c.ww002.siemens.net> <58BD0469C48A7443A479A13D101685E3024DC83B@ala-mail09.corp.ad.wrs.com> In-Reply-To: <58BD0469C48A7443A479A13D101685E3024DC83B@ala-mail09.corp.ad.wrs.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigAD9119597C830E9B20678AF1" Sender: jan.kiszka@web.de Subject: [Qemu-devel] [PATCH] net: Avoid gcc'ism in net_host_device_add List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Krumme, Chris" Cc: Mark McLoughlin , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigAD9119597C830E9B20678AF1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Krumme, Chris wrote: > Sorry for the last comment, but I was out of town.=20 >=20 >> -----Original Message----- >> From:=20 >> qemu-devel-bounces+chris.krumme=3Dwindriver.com@nongnu.org=20 >> [mailto:qemu-devel-bounces+chris.krumme=3Dwindriver.com@nongnu.o >> rg] On Behalf Of Jan Kiszka >> Sent: Sunday, April 19, 2009 5:04 AM >> To: qemu-devel@nongnu.org >> Cc: Mark McLoughlin >> Subject: [Qemu-devel] [PATCH v2 04/11] monitor: Improve host_net_add >> >> Fix the documentation of the host_net_add monitor command and=20 >> 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 652d1f0..ca2a56d 100644 >> --- a/monitor.c >> +++ b/monitor.c >> @@ -1730,8 +1730,8 @@ static const mon_cmd_t mon_cmds[] =3D { >> "add drive to PCI=20 >> storage controller" }, >> { "pci_add", "sss", pci_device_hot_add,=20 >> "pci_addr=3Dauto|[[:]:] nic|storage=20 >> [[vlan=3Dn][,macaddr=3Daddr][,model=3Dtype]]=20 >> [file=3Dfile][,if=3Dtype][,bus=3Dnr]...", "hot-add PCI device" }, >> { "pci_del", "s", pci_device_hot_remove,=20 >> "pci_addr=3D[[:]:]", "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 ca4d87f..22faa40 100644 >> --- a/net.c >> +++ b/net.c >> @@ -1860,7 +1860,9 @@ void net_host_device_add(Monitor *mon,=20 >> const char *device, const char *opts) >> monitor_printf(mon, "invalid host network device=20 >> %s\n", device); >> return; >> } >> - net_client_init(device, opts); >> + if (net_client_init(device, opts ? : "") < 0) { >=20 > Is this a gcc extension? Do we want to introduce this construct to the= > code base. Valid remark, fix below. Thanks, Jan --------> Signed-off-by: Jan Kiszka --- net.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net.c b/net.c index dcd27fe..ddcdf5b 100644 --- a/net.c +++ b/net.c @@ -2085,7 +2085,7 @@ void net_host_device_add(Monitor *mon, const char *= device, const char *opts) monitor_printf(mon, "invalid host network device %s\n", device);= return; } - if (net_client_init(device, opts ? : "") < 0) { + if (net_client_init(device, opts ? opts : "") < 0) { monitor_printf(mon, "adding host network device %s failed\n", de= vice); } } --------------enigAD9119597C830E9B20678AF1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkn3WEcACgkQniDOoMHTA+lqAQCfY7be/wvTQ2O/W8Hw+i/E1d8B +T0Anj6YluJrXTxSPvAhqJY1Ms889pMo =I37Q -----END PGP SIGNATURE----- --------------enigAD9119597C830E9B20678AF1--