[libvirt] [PATCH] Recheck disk backing chains after snapshot

Eric Blake eblake at redhat.com
Fri Apr 25 16:45:36 UTC 2014


On 04/25/2014 07:13 AM, Jiri Denemark wrote:
> When a snapshot operation finishes we have to recheck the backing chain
> of all disks involved in the snapshot. And we need to do that even if
> the operation failed because some of the disks might have changed if
> QEMU did not support transactions.
> 
> Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
> ---
> 
> Notes:
>     - BlockRebase and BlockCommit already recheck the backing chain when we
>       get an event about a completed block job (in qemuProcessHandleBlockJob)
> 
>  src/qemu/qemu_driver.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 

>   cleanup:
> +    /* recheck backing chains of all disks involved in the snapshot */
> +    orig_err = virSaveLastError();
> +    for (i = 0; i < snap->def->ndisks; i++) {
> +        if (snap->def->disks[i].snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_NONE)
> +            continue;

Do we really need to reprobe internal snapshots?  That is, could this be:
if (snap->def->disks[i].snapshot != VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)

But this makes sense as an improvement to the current code, so:

ACK.

-- 
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/20140425/fa22bee7/attachment-0001.sig>


More information about the libvir-list mailing list