From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53492) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aR0SX-0004CI-KK for qemu-devel@nongnu.org; Wed, 03 Feb 2016 11:39:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aR0SW-0000Vq-Ng for qemu-devel@nongnu.org; Wed, 03 Feb 2016 11:39:13 -0500 References: <1454517196-4560-1-git-send-email-mreitz@redhat.com> <1454517196-4560-2-git-send-email-mreitz@redhat.com> <56B22CFC.4060907@redhat.com> From: Max Reitz Message-ID: <56B22D27.9020307@redhat.com> Date: Wed, 3 Feb 2016 17:39:03 +0100 MIME-Version: 1.0 In-Reply-To: <56B22CFC.4060907@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1eQ7GEH5dx2Vl8DjHEIsIQEP362TrT4F1" Subject: Re: [Qemu-devel] [PATCH 1/2] block/nbd: Reject port parameter without host List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-block@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , qemu-devel@nongnu.org, Markus Armbruster This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1eQ7GEH5dx2Vl8DjHEIsIQEP362TrT4F1 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03.02.2016 17:38, Eric Blake wrote: > On 02/03/2016 09:33 AM, Max Reitz wrote: >> This is better than the generic block layer finding out later that the= >> port parameter has not been used. >> >> Signed-off-by: Max Reitz >> --- >> block/nbd.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/block/nbd.c b/block/nbd.c >> index 1a90bc7..063c403 100644 >> --- a/block/nbd.c >> +++ b/block/nbd.c >> @@ -201,6 +201,10 @@ static SocketAddress *nbd_config(BDRVNBDState *s,= QDict *options, char **export, >> } >> return NULL; >> } >> + if (qdict_haskey(options, "port") && !qdict_haskey(options, "host= ")) { >> + error_setg(errp, "port may not be used without host."); >=20 > No trailing '.' I plead guilty. I was tempted by the error_setg() calls above this one, I'll add a patch to fix them in v2. > With that fixed, > Reviewed-by: Eric Blake Thanks, Max --1eQ7GEH5dx2Vl8DjHEIsIQEP362TrT4F1 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 iQEcBAEBCAAGBQJWsi0nAAoJEDuxQgLoOKytqVIH/Ri1B1kaWQFxZwCwAhBnyQH0 OP9Rv1b1FCpjYV2ex83fh7OR+XAHJum5RMasoG89DcwQafHIlFDZhdcVydAxp/1s KdcTCV8DWpXA8KUm3XUd8eVS9uW/Tlc8H2NehYwl1XzssJmtFvg4FhHXwWMeaEyt FcuwM1AoOKfSAWQibc9nxuw0eUbkvqGL7v584Ov5wNMRiLKqbBARKzf4vEM2mp0w E1zBPtXXnAPS9yJ8kz6ugUxtBVmKf6y7v5V1NWsT2nhBIiwK1ybTLnFlHe5eKV+Y 4n9jCdKiKnTFdas18na8sw2w2FFwLrxAtE9etvUxurd+l6+KyhK9O3pohizUZyI= =asyW -----END PGP SIGNATURE----- --1eQ7GEH5dx2Vl8DjHEIsIQEP362TrT4F1--