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

Andrea Bolognani abologna at redhat.com
Mon Sep 17 12:33:47 UTC 2018


On Mon, 2018-09-17 at 13:51 +0800, Yi Min Zhao wrote:
> 在 2018/9/11 下午10:31, Andrea Bolognani 写道:
> > > +{
> > > +    if (!virZPCIDeviceAddressIsEmpty(&dev->addr.pci.zpci))
> > > +        return qemuAppendZPCIDevStr(cmd, dev);
> > > +
> > > +    return 0;
> > 
> > I'd rather see this as
> > 
> >    if (virZPCIDeviceAddressIsEmpty(&dev->addr.pci.zpci))
> >        return 0;
> > 
> >    return qemuAppendZPCIDevStr(cmd, dev);
> > 
> > instead.
> 
> How about using switch? I think extension flag should be check and
> then build command for each case although there's only zpci case.

You can't really sensibly use a switch() for flags. Unless I have
mistaken what you had in mind...

-- 
Andrea Bolognani / Red Hat / Virtualization




More information about the libvir-list mailing list