[libvirt] [PATCH 3/5] qemu: Refactor qemuCapsParsePCIDeviceStrs using virCommand

Jiri Denemark jdenemar at redhat.com
Thu Jan 13 14:34:07 UTC 2011


> > +
> > +static char *
> > +qemuCapsExtractDeviceProps(const char *qemu,
> > +                           const char *device)
> > +{
> > +    virCommandPtr cmd = virCommandNew(qemu);
> > +    char *output = NULL;
> > +
> > +    virCommandAddArg(cmd, "-device");
> > +    virCommandAddArgFormat(cmd, "%s,?", device);
> 
> Phooey - I have a patch in my smartcard series that conflicts with this.
>  But I like mine better - I added testsuite coverage of device parsing,
> and have only 1 qemu run for all devices rather than 1 run per device.
> I guess I'd better clean it up and post right away, to compare our two
> approaches.

I went the minimal-effort way since it doesn't matter much now when we only
check for two device types. And the better approach could have been done as
another patch in the future.

But since you already have it, it'd be better to push that first. You can also
take just the most important part of it and do the rest in a separate patch
later to minimize it's time consumption now.

Jirka




More information about the libvir-list mailing list