On Mon, Jan 6, 2020 at 5:58 PM Peter Krempa <[email protected]> wrote:
> On Wed, Jan 01, 2020 at 13:06:32 +0800, Han Han wrote: > > From: Han Han <[email protected]> > > > > For qemu object like rng-builtin, there are no properties after id > > property. We should always set comma after object id. Otherwise it will > > cause trailing comma on object: > > -object rng-builtin,id=ID, > > > > Signed-off-by: Han Han <[email protected]> > > --- > > src/util/virqemu.c | 13 +++++++------ > > 1 file changed, 7 insertions(+), 6 deletions(-) > > > > diff --git a/src/util/virqemu.c b/src/util/virqemu.c > > index f3a233af..72151e43 100644 > > --- a/src/util/virqemu.c > > +++ b/src/util/virqemu.c > > @@ -239,12 +239,13 @@ > virQEMUBuildObjectCommandlineFromJSONInternal(virBufferPtr buf, > > return -1; > > } > > > > - virBufferAsprintf(buf, "%s,id=%s,", type, alias); > > - > > - if (props && > > - virQEMUBuildCommandLineJSON(props, buf, > > - > virQEMUBuildCommandLineJSONArrayBitmap) < 0) > > - return -1; > > + virBufferAsprintf(buf, "%s,id=%s", type, alias); > > Keep the newline here. > > > + if (props) { > > + virBufferAsprintf(buf, ","); > > Use vir BufferAddLit instead. > virBufferAsprintf is for format strings and virBufferAddLit is for const strings, right? > > > + if (virQEMUBuildCommandLineJSON(props, buf, > > + virQEMUBuildCommandLineJSONArrayBitmap) > < 0) > > + return -1; > > + } > > > > return 0; > > } > > -- > > 2.23.0 > > > > -- > > libvir-list mailing list > > [email protected] > > https://www.redhat.com/mailman/listinfo/libvir-list > > -- Best regards, ----------------------------------- Han Han Quality Engineer Redhat. Email: [email protected] Phone: +861065339333
-- libvir-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/libvir-list
