Received: from eggs.gnu.org ([2001:4830:134:3::10]:57499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wgmyq-0003SL-F3 for qemu-devel@nongnu.org; Sat, 03 May 2014 23:20:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wgmyl-0002Dm-VS for qemu-devel@nongnu.org; Sat, 03 May 2014 23:20:44 -0400 Received: from soto.provo.novell.com ([137.65.250.214]:56925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wgmyl-0002Df-MZ for qemu-devel@nongnu.org; Sat, 03 May 2014 23:20:39 -0400 Message-Id: <5366227D0200006600024896@soto.provo.novell.com> Date: Sat, 03 May 2014 21:20:29 -0600 From: "Chun Yan Liu" References: <1398762656-26079-1-git-send-email-cyliu@suse.com> <1398762656-26079-4-git-send-email-cyliu@suse.com> <535FD3B6.6020701@redhat.com> In-Reply-To: <535FD3B6.6020701@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: Re: [Qemu-devel] [PATCH V26 03/32] QemuOpts: repurpose qemu_opts_print to replace print_option_parameters List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Eric Blake Cc: stefanha@redhat.com >>> On 4/30/2014 at 12:30 AM, in message <535FD3B6.6020701@redhat.com>, = Eric Blake wrote:=20 > On 04/29/2014 03:10 AM, Chunyan Liu wrote:=20 > > Currently this function is not used anywhere. In later patches, it = will=20 > > replace print_option_parameters. To avoid print info changes, = change=20 > > qemu_opts_print from fprintf stderr to printf to keep consistent = with=20 > > print_option_parameters, remove last printf and print size/number = with=20 > > opt->value.uint instead of opt->str.=20 > > =20 > > Signed-off-by: Chunyan Liu =20 > > ---=20 > > util/qemu-option.c | 10 ++++++----=20 > > 1 file changed, 6 insertions(+), 4 deletions(-)=20 > =20 > I would prefer to see this patch first, and 2/32 second; I'd also = prefer=20 > to see the signature change (changing int to void return, and dropping=20= > dummy parameter) in this patch.=20 > =20 > > + } else if ((desc->type =3D=3D QEMU_OPT_SIZE ||=20 > > + desc->type =3D=3D QEMU_OPT_NUMBER) && opt) {=20 > > + printf("%s=3D%" PRId64 " ", desc->name, opt->value.uint);= =20 > =20 > Shouldn't this be PRIu64, since you are printing an unsigned int?=20 print_option_parameters uses PRId64, so here using PRId64 too to keep output unchanged. In qemu-iotests, there are some tests having negative size, like 'size=3D-1024', changing to PRIu64 will cause such iotests = failed. > =20 > -- =20 > Eric Blake eblake redhat com +1-919-301-3266=20 > Libvirt virtualization library http://libvirt.org=20 > =20 > =20