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

Eric Blake eblake at redhat.com
Thu Jan 13 14:22:13 UTC 2011


On 01/13/2011 06:04 AM, Jiri Denemark wrote:
> ---
>  src/qemu/qemu_capabilities.c |   58 +++++++++++++++++++----------------------
>  1 files changed, 27 insertions(+), 31 deletions(-)
> 
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 3d10b42..0fb6ec9 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -1087,48 +1087,44 @@ fail:
>      return -1;
>  }
>  
> +
> +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.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110113/fdf9294a/attachment-0001.sig>


More information about the libvir-list mailing list