[libvirt] [PATCHv2 16/16] blockjob: implement shallow commit flag in qemu

Eric Blake eblake at redhat.com
Wed Oct 17 21:39:22 UTC 2012


On 10/17/2012 03:28 PM, Laine Stump wrote:
> On 10/13/2012 06:00 PM, Eric Blake wrote:
>> Now that we can crawl the chain of backing files, we can do
>> argument validation and implement the 'shallow' flag.  In
>> testing this, I discovered that it can be handy to pass the
>> shallow flag and an explicit base, as a means of validating
>> that the base is indeed the file we expected.
>>

>> +    } else if (!(top_canon = virStorageFileChainLookup(disk->chain, disk->src,
>> +                                                       top, &top_meta,
>> +                                                       &top_parent))) {

>> +    } else if (!(base_canon = virStorageFileChainLookup(top_meta, top_canon,
>> +                                                        base, NULL, NULL))) {

>> +    if ((flags & VIR_DOMAIN_BLOCK_COMMIT_SHALLOW) &&
>> +        base_canon != top_meta->backingStore) {

Here's one of those places where I'm exploiting the pointer-equality
(rather than the more expensive STREQ) given by
virStorageFileChainLookup from patch 11; I'll add a comment in v3 so
that it is more obvious why I expect it to work.

> 
> Looks reasonable. ACK.

Yay - the bulk of the time in me writing this patch was coming up with
the right interface for virStorageFileChainLookup (and then rebasing
those changes in earlier to the series) so that I had everything I needed.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

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


More information about the libvir-list mailing list