Received: from eggs.gnu.org ([2001:4830:134:3::10]:52957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z58AN-0001Ox-0l for qemu-devel@nongnu.org; Wed, 17 Jun 2015 03:53:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z58AM-0000h7-6E for qemu-devel@nongnu.org; Wed, 17 Jun 2015 03:53:46 -0400 From: Markus Armbruster References: <06990ada8a0d0beb9bb942b5b9ddc1c19a9a4664.1434458391.git.DirtY.iCE.hu@gmail.com> Date: Wed, 17 Jun 2015 09:53:36 +0200 In-Reply-To: <06990ada8a0d0beb9bb942b5b9ddc1c19a9a4664.1434458391.git.DirtY.iCE.hu@gmail.com> (=?utf-8?B?IkvFkXbDoWfDsywgWm9sdMOhbiIncw==?= message of "Tue, 16 Jun 2015 14:49:06 +0200") Message-ID: <87k2v2g48v.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 3/6] opts: do not print separator before first item in qemu_opts_print List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?B?S8WRdsOhZ8OzLCBab2x0w6Fu?= Cc: Kevin Wolf , qemu-devel@nongnu.org, "open list:Block layer core" , Gerd Hoffmann "K=C5=91v=C3=A1g=C3=B3, Zolt=C3=A1n" writes: > This allows to print options in a format that the user would actually wri= te it > on the command line (foo=3Dbar,baz=3Dasd,etc=3Ddef), without prepending a= spurious > comma at the beginning of the list. Suggest: This will let us print... > Only block.c depended on the old behavior, but it was also updated. I'd drop this sentence. > > Signed-off-by: K=C5=91v=C3=A1g=C3=B3, Zolt=C3=A1n > --- > block.c | 2 +- > util/qemu-option.c | 5 ++++- > 2 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/block.c b/block.c > index dd4f58d..c5d456c 100644 > --- a/block.c > +++ b/block.c > @@ -3823,7 +3823,7 @@ void bdrv_img_create(const char *filename, const ch= ar *fmt, > } >=20=20 > if (!quiet) { > - printf("Formatting '%s', fmt=3D%s", filename, fmt); > + printf("Formatting '%s', fmt=3D%s ", filename, fmt); > qemu_opts_print(opts, " "); > puts(""); > } > diff --git a/util/qemu-option.c b/util/qemu-option.c > index 840f5f7..b347d92 100644 > --- a/util/qemu-option.c > +++ b/util/qemu-option.c > @@ -728,14 +728,16 @@ void qemu_opts_del(QemuOpts *opts) > g_free(opts); > } >=20=20 > -void qemu_opts_print(QemuOpts *opts, const char *sep) > +void qemu_opts_print(QemuOpts *opts, const char *d_sep) > { > QemuOpt *opt; > QemuOptDesc *desc =3D opts->list->desc; > + const char *sep =3D ""; >=20=20 > if (desc[0].name =3D=3D NULL) { > QTAILQ_FOREACH(opt, &opts->head, next) { > printf("%s%s=3D\"%s\"", sep, opt->name, opt->str); > + sep =3D d_sep; > } > return; > } > @@ -755,6 +757,7 @@ void qemu_opts_print(QemuOpts *opts, const char *sep) > } else { > printf("%s%s=3D%s", sep, desc->name, value); > } > + sep =3D d_sep; > } > } No idea what d_ means. Let's rename d_sep to separator. With that rename: Reviewed-by: Markus Armbruster