[libvirt] [PATCH 6/9] storage_backend: Convert virRunWithHook usage to virCommand

Eric Blake eblake at redhat.com
Fri May 13 22:13:05 UTC 2011


On 05/13/2011 02:10 PM, Cole Robinson wrote:
> virRunWithHook is now unused, so we can drop it. Tested w/ raw + qcow2
> volume creation and copying.
> 
> v2:
>     Use opaque data to skip hook second time around
>     Simply command building
> 
> Signed-off-by: Cole Robinson <crobinso at redhat.com>
> ---
>  src/libvirt_private.syms      |    1 -
>  src/storage/storage_backend.c |  162 ++++++++++++++++------------------------
>  src/util/util.c               |   23 ++----
>  src/util/util.h               |    3 -
>  4 files changed, 71 insertions(+), 118 deletions(-)
> 

> @@ -926,13 +895,12 @@ virStorageBackendCreateQcowCreate(virConnectPtr conn ATTRIBUTE_UNUSED,
>          return -1;
>      }
>  
> -    imgargv[0] = virFindFileInPath("qcow-create");
> -    imgargv[1] = size;
> -    imgargv[2] = vol->target.path;
> -    imgargv[3] = NULL;
> +    create_tool = virFindFileInPath("qcow-create");
> +    cmd = virCommandNewArgList(create_tool, size, vol->target.path, NULL);

Nit - virCommand (via virExecWithHook) already calls
virFindFileInPath(argv[0]) if you pass a relative file name, so you
could simplify this to:

virCommandNewArgList("qcow-create", size, ...)

ACK.

-- 
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/20110513/1f47c97c/attachment-0001.sig>


More information about the libvir-list mailing list