Re: [libvirt] [PATCH v5 10/13] qemu: Generate and use zPCI device in QEMU command line

2018-09-18 Thread Andrea Bolognani
On Tue, 2018-09-18 at 15:40 +0800, Yi Min Zhao wrote: > 在 2018/9/17 下午8:33, Andrea Bolognani 写道: > > On Mon, 2018-09-17 at 13:51 +0800, Yi Min Zhao wrote: > > > How about using switch? I think extension flag should be check and > > > then build command for each case although there's only zpci

Re: [libvirt] [PATCH v5 10/13] qemu: Generate and use zPCI device in QEMU command line

2018-09-18 Thread Yi Min Zhao
在 2018/9/17 下午8:33, Andrea Bolognani 写道: On Mon, 2018-09-17 at 13:51 +0800, Yi Min Zhao wrote: 在 2018/9/11 下午10:31, Andrea Bolognani 写道: +{ +if (!virZPCIDeviceAddressIsEmpty(>addr.pci.zpci)) +return qemuAppendZPCIDevStr(cmd, dev); + +return 0; I'd rather see this as if

Re: [libvirt] [PATCH v5 10/13] qemu: Generate and use zPCI device in QEMU command line

2018-09-17 Thread Andrea Bolognani
On Mon, 2018-09-17 at 13:51 +0800, Yi Min Zhao wrote: > 在 2018/9/11 下午10:31, Andrea Bolognani 写道: > > > +{ > > > +if (!virZPCIDeviceAddressIsEmpty(>addr.pci.zpci)) > > > +return qemuAppendZPCIDevStr(cmd, dev); > > > + > > > +return 0; > > > > I'd rather see this as > > > >if

Re: [libvirt] [PATCH v5 10/13] qemu: Generate and use zPCI device in QEMU command line

2018-09-16 Thread Yi Min Zhao
在 2018/9/11 下午10:31, Andrea Bolognani 写道: On Tue, 2018-09-04 at 16:39 +0800, Yi Min Zhao wrote: [...] +char * +qemuBuildZPCIDevStr(virDomainDeviceInfoPtr dev) +{ +virBuffer buf = VIR_BUFFER_INITIALIZER; + +virBufferAddLit(, "zpci"); +virBufferAsprintf(, ",uid=%u",

Re: [libvirt] [PATCH v5 10/13] qemu: Generate and use zPCI device in QEMU command line

2018-09-11 Thread Andrea Bolognani
On Tue, 2018-09-04 at 16:39 +0800, Yi Min Zhao wrote: [...] > +char * > +qemuBuildZPCIDevStr(virDomainDeviceInfoPtr dev) > +{ > +virBuffer buf = VIR_BUFFER_INITIALIZER; > + > +virBufferAddLit(, "zpci"); > +virBufferAsprintf(, ",uid=%u", dev->addr.pci.zpci.uid); > +

[libvirt] [PATCH v5 10/13] qemu: Generate and use zPCI device in QEMU command line

2018-09-04 Thread Yi Min Zhao
Add new functions to generate zPCI command string and append it to QEMU command line. And the related tests are added. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko --- src/qemu/qemu_command.c