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

Cole Robinson crobinso at redhat.com
Tue May 17 14:25:38 UTC 2011


On 05/13/2011 06:13 PM, Eric Blake wrote:
> 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.
> 

Thanks for the review, pushed with that fix. Also pushed 1, 4, and 5.

- Cole




More information about the libvir-list mailing list