[libvirt] [PATCH v2 04/10] conf: store mirroring information in virStorageSource

Eric Blake eblake at redhat.com
Fri Jun 6 15:55:19 UTC 2014


On 06/06/2014 03:25 AM, Peter Krempa wrote:
> On 06/06/14 00:52, Eric Blake wrote:
>> The current implementation of 'virsh blockcopy' (virDomainBlockRebase)
>> is limited to copying to a local file name.  But future patches want
>> to extend it to also copy to network disks.  This patch converts over
>> to a virStorageSourcePtr, although it should have no semantic change
>> visible to the user, in anticipation of those future patches being
>> able to use more fields for non-file destinations.
>>

>> -    char *mirror;
>> -    int mirrorFormat; /* virStorageFileFormat */
>> +    virStorageSourcePtr mirror;
> 
> You adjust the type here, but don't adjust the code in
> virDomainDiskDefFree ...
> 
>>     bool mirroring;
>>
>>     struct {
> 
> You need to change:
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index b8e7c50..827c401 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -1203,7 +1203,7 @@ virDomainDiskDefFree(virDomainDiskDefPtr def)
>      virStorageSourceFree(def->src);
>      VIR_FREE(def->serial);
>      VIR_FREE(def->dst);
> -    VIR_FREE(def->mirror);
> +    virStorageSourceFree(def->mirror);

D'oh - I missed one (I guess I had been grep'ing for disk->mirror,
rather than .*->mirror).  Thanks for spotting it.

> 
> ACK with that addressed,

Findings in 3 and 4 addressed, and I've pushed through this point of the
series.

I realized off-list that active commit has a major difference from
blockcopy: right now, libvirt refuses to do blockcopy on anything but a
transient domain, so there is no impact to a persistent domain
definition.  But since I allowed block-commit on a persistent domain, if
the transient definition is updated due to a pivot at the end of a
blockcopy, the persistent definition must also be altered so that the
next boot of the domain will use the right file (on a pivot, the old
active file becomes stale and will no longer contain a consistent view
of guest data).  The alteration of the persistent definition is similar
to what must happen when snapshot creation alters a disk source.

-- 
Eric Blake   eblake 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: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140606/8e1356df/attachment-0001.sig>


More information about the libvir-list mailing list