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

Jiri Denemark jdenemar at redhat.com
Sun Apr 27 19:50:39 UTC 2014


On Fri, Apr 25, 2014 at 10:45:36 -0600, Eric Blake wrote:
> 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)

Hmm, right you are. I changed it and pushed the patch. Thanks.

Jirka




More information about the libvir-list mailing list