From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHv7Y-0004l8-Th for qemu-devel@nongnu.org; Thu, 14 Aug 2014 09:31:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHv7U-0001a7-7p for qemu-devel@nongnu.org; Thu, 14 Aug 2014 09:31:12 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:36510 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHv7T-0001a2-Un for qemu-devel@nongnu.org; Thu, 14 Aug 2014 09:31:08 -0400 Date: Thu, 14 Aug 2014 15:30:17 +0200 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140814133017.GM2009@irqsave.net> References: <1407950419-3486-1-git-send-email-pl@kamp.de> <1407950419-3486-4-git-send-email-pl@kamp.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1407950419-3486-4-git-send-email-pl@kamp.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCHv2 3/3] qemu-nbd: fix indentation and coding style List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: kwolf@redhat.com, hutao@cn.fujitsu.com, qemu-devel@nongnu.org, mreitz@redhat.com, stefanha@redhat.com, pbonzini@redhat.com, armbru@redhat.com The Wednesday 13 Aug 2014 =E0 19:20:19 (+0200), Peter Lieven wrote : > Signed-off-by: Peter Lieven > --- > qemu-nbd.c | 75 +++++++++++++++++++++++++++++++---------------------= -------- > 1 file changed, 39 insertions(+), 36 deletions(-) >=20 > diff --git a/qemu-nbd.c b/qemu-nbd.c > index 6ef8b10..9bc152e 100644 > --- a/qemu-nbd.c > +++ b/qemu-nbd.c > @@ -39,10 +39,10 @@ > #include > #include > =20 > -#define SOCKET_PATH "/var/lock/qemu-nbd-%s" > -#define QEMU_NBD_OPT_CACHE 1 > -#define QEMU_NBD_OPT_AIO 2 > -#define QEMU_NBD_OPT_DISCARD 3 > +#define SOCKET_PATH "/var/lock/qemu-nbd-%s" > +#define QEMU_NBD_OPT_CACHE 1 > +#define QEMU_NBD_OPT_AIO 2 > +#define QEMU_NBD_OPT_DISCARD 3 > #define QEMU_NBD_OPT_DETECT_ZEROES 4 We could also make these an enum. Reviewed-by: Benoit Canet > =20 > static NBDExport *exp; > @@ -60,44 +60,44 @@ static void usage(const char *name) > "Usage: %s [OPTIONS] FILE\n" > "QEMU Disk Network Block Device Server\n" > "\n" > -" -h, --help display this help and exit\n" > -" -V, --version output version information and exit\n" > +" -h, --help display this help and exit\n" > +" -V, --version output version information and exit\n" > "\n" > "Connection properties:\n" > -" -p, --port=3DPORT port to listen on (default `%d')\n" > -" -b, --bind=3DIFACE interface to bind to (default `0.0.0.0')\n" > -" -k, --socket=3DPATH path to the unix socket\n" > -" (default '"SOCKET_PATH"')\n" > -" -e, --shared=3DNUM device can be shared by NUM clients (default= '1')\n" > -" -t, --persistent don't exit on the last connection\n" > -" -v, --verbose display extra debugging information\n" > +" -p, --port=3DPORT port to listen on (default `%d')\n" > +" -b, --bind=3DIFACE interface to bind to (default `0.0.0.0'= )\n" > +" -k, --socket=3DPATH path to the unix socket\n" > +" (default '"SOCKET_PATH"')\n" > +" -e, --shared=3DNUM device can be shared by NUM clients (de= fault '1')\n" > +" -t, --persistent don't exit on the last connection\n" > +" -v, --verbose display extra debugging information\n" > "\n" > "Exposing part of the image:\n" > -" -o, --offset=3DOFFSET offset into the image\n" > -" -P, --partition=3DNUM only expose partition NUM\n" > +" -o, --offset=3DOFFSET offset into the image\n" > +" -P, --partition=3DNUM only expose partition NUM\n" > "\n" > #ifdef __linux__ > "Kernel NBD client support:\n" > -" -c, --connect=3DDEV connect FILE to the local NBD device DEV\n" > -" -d, --disconnect disconnect the specified device\n" > +" -c, --connect=3DDEV connect FILE to the local NBD device DE= V\n" > +" -d, --disconnect disconnect the specified device\n" > "\n" > #endif > "\n" > "Block device options:\n" > -" -f, --format=3DFORMAT set image format (raw, qcow2, ...)\n" > -" -r, --read-only export read-only\n" > -" -s, --snapshot use FILE as an external snapshot, create a tem= porary\n" > -" file with backing_file=3DFILE, redirect the wr= ite to\n" > -" the temporary one\n" > +" -f, --format=3DFORMAT set image format (raw, qcow2, ...)\n" > +" -r, --read-only export read-only\n" > +" -s, --snapshot use FILE as an external snapshot, create = a temporary\n" > +" file with backing_file=3DFILE, redirect t= he write to\n" > +" the temporary one\n" > " -l, --load-snapshot=3DSNAPSHOT_PARAM\n" > -" load an internal snapshot inside FILE and expo= rt it\n" > -" as an read-only device, SNAPSHOT_PARAM format = is\n" > -" 'snapshot.id=3D[ID],snapshot.name=3D[NAME]', o= r\n" > -" '[ID_OR_NAME]'\n" > -" -n, --nocache disable host cache\n" > -" --cache=3DMODE set cache mode (none, writeback, ...)\n" > +" load an internal snapshot inside FILE and= export it\n" > +" as an read-only device, SNAPSHOT_PARAM fo= rmat is\n" > +" 'snapshot.id=3D[ID],snapshot.name=3D[NAME= ]', or\n" > +" '[ID_OR_NAME]'\n" > +" -n, --nocache disable host cache\n" > +" --cache=3DMODE set cache mode (none, writeback, ...)\n= " > #ifdef CONFIG_LINUX_AIO > -" --aio=3DMODE set AIO mode (native or threads)\n" > +" --aio=3DMODE set AIO mode (native or threads)\n" > #endif > " --discard=3DMODE set discard mode (ignore, unmap)\n" > " --detect-zeroes=3DMODE set detect-zeroes mode (off, on, discar= d)\n" > @@ -546,15 +546,18 @@ int main(int argc, char **argv) > break; > case 'P': > partition =3D strtol(optarg, &end, 0); > - if (*end) > + if (*end) { > errx(EXIT_FAILURE, "Invalid partition `%s'", optarg); > - if (partition < 1 || partition > 8) > + } > + if (partition < 1 || partition > 8) { > errx(EXIT_FAILURE, "Invalid partition %d", partition); > + } > break; > case 'k': > sockpath =3D optarg; > - if (sockpath[0] !=3D '/') > + if (sockpath[0] !=3D '/') { > errx(EXIT_FAILURE, "socket path must be absolute\n"); > + } > break; > case 'd': > disconnect =3D true; > @@ -574,9 +577,9 @@ int main(int argc, char **argv) > case 'f': > fmt =3D optarg; > break; > - case 't': > - persistent =3D 1; > - break; > + case 't': > + persistent =3D 1; > + break; > case 'v': > verbose =3D 1; > break; > @@ -611,7 +614,7 @@ int main(int argc, char **argv) > =20 > printf("%s disconnected\n", argv[optind]); > =20 > - return 0; > + return 0; > } > =20 > if (device && !verbose) { > --=20 > 1.7.9.5 >=20 >=20