[libvirt] [PATCH] qemu: Do not override config XML in case of snapshot revert

Eric Blake eblake at redhat.com
Wed May 15 18:17:14 UTC 2019


On 5/15/19 1:03 PM, Daniel Henrique Barboza wrote:
> 
> 
> On 5/15/19 12:49 PM, Eric Blake wrote:
>> If you reboot the guest, the inactive XML will become active and the
>> guest will have a new device. But if the guest continues running without
>> rebooting, the inactive XML will be different from the live XML. Whether
>> or not the guest rebooted, a revert must NOT expose the new device to
>> the live XML installed during the revert.  But there is still a question
>> as to whether the revert should also undo the inactive XML change that
>> was made after the snapshot was created, or leave the inactive XML alone
>> (that is, after we revert, will a fresh boot once again pick up the new
>> device, or will the fresh boot be stuck with the configuration as though
>> step 3 had never happened).
> 
> Maybe we should consider that, in Libvirt, the snapshot state consists
> of both inactive and live XMLs.

Right now, that is untrue. The snapshot state consists of a single XML
(either the live XML for a live or disk-only snapshot, or the inactive
XML for an offline snapshot). We could make it true, but it is an
invasive change and we'd still have to cope with existing live snapshots
that didn't have both stored.

> Like Michal suggested in his first reply.
> It appears to be the most consistent way of dealing with the revert of a
> VM state - the change is that the VM state is now both inactive and
> active XMLs.

Reverting to an offline or disk-only snapshot is easy - there's only one
XML to worry about (once you've reverted, the domain is offline, so
there is no live XML - unless the revert command also included the flag
to start the domain in which case the live XML will match the
just-reverted offline XML). Reverting to an online snapshot is trickier
(right now, we MUST overwrite the live XML to perform the revert
correctly, and we HAPPEN to overwrite the inactive XML as well) - but
there you can argue that we've merely been buggy for a few years, and
that we should leave the inactive XML untouched in that case.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

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


More information about the libvir-list mailing list