[libvirt] [PATCHv5 22/28] util: storage: Return complete parent info from virStorageFileChainLookup

Peter Krempa pkrempa at redhat.com
Wed Jul 9 09:57:54 UTC 2014


On 07/09/14 01:28, Eric Blake wrote:
> On 07/04/2014 05:29 AM, Peter Krempa wrote:
>> Instead of just returning the parent path, return the complete parent
>> source structure.
>> ---
>>  src/qemu/qemu_driver.c    | 16 ++++-----
>>  src/util/virstoragefile.c | 17 ++++------
>>  src/util/virstoragefile.h |  2 +-
>>  tests/virstoragetest.c    | 86 ++++++++++++++++++++++-------------------------
>>  4 files changed, 56 insertions(+), 65 deletions(-)
> 
>> @@ -15585,10 +15585,9 @@ qemuDomainBlockCommit(virDomainPtr dom,
>>      clean_access = true;
>>      if (qemuDomainPrepareDiskChainElement(driver, vm, disk, baseSource,
>>                                            VIR_DISK_CHAIN_READ_WRITE) < 0 ||
>> -        (top_parent && top_parent != disk->src->path &&
>> -         qemuDomainPrepareDiskChainElementPath(driver, vm, disk,
>> -                                               top_parent,
>> -                                               VIR_DISK_CHAIN_READ_WRITE) < 0))
>> +        (top_parent != disk->src &&
>> +         qemuDomainPrepareDiskChainElement(driver, vm, disk, top_parent,
>> +                                           VIR_DISK_CHAIN_READ_WRITE) < 0))
> 
> Oops.  This doesn't quite work with active commit (where top_parent is
> NULL, but where qemuDomainPrepareDiskChainElement isn't too happy to get
> a NULL pointer).  But then again, I'm rebasing my active commit on top
> of you, so your patch is not wrong if it goes in first.  If you want,
> restore the condition to '(top_parent && top_parent != disk->src &&...)'.

I went with the active_commit tolerant approach as the code was actually
there before this patch.

Peter


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


More information about the libvir-list mailing list