[PATCH 2/3] qemuSnapshotCreateActiveExternal: Don't thaw filesystems when freeze fails

Pavel Hrdina phrdina at redhat.com
Mon Feb 15 18:17:24 UTC 2021


On Mon, Feb 15, 2021 at 06:27:50PM +0100, Peter Krempa wrote:
> If we didn't freeze any filesystems we should not even attempt thawing
> them. Additionally 'guest-fsfreeze-freeze' fails if the filesystems are
> already frozen, where thawing them may break users data integrity if
> they used VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE accidentally after an
> explicit virDomainFSFreeze and the next snapshot without that flag would
> be taken with already thawed filesystems.
> 
> This effectively reverts 7c736bab06479ccec59df69fb79a5c06d112d8fb .
> Libvirt nowadays checks whether the guest agent is connected and pings
> it before issuing an command so it's very unlikely that we'd end up in a
> situation where qemuSnapshotCreateActiveExternal froze filesystems and
> didn't thaw them.

It would happen if QEMU returned different reply for the command then
we expect which could be considered as QEMU bug.

In that case I guess it's better to leave the VM with frozen filesystems
and exit the API with error like this patch will do.

> Additionally we now discourage the use of
> VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE since users have better control if
> they freeze the FS themselves.
> 
> Signed-off-by: Peter Krempa <pkrempa at redhat.com>
> ---
>  src/qemu/qemu_snapshot.c | 28 ++++++++++++----------------
>  1 file changed, 12 insertions(+), 16 deletions(-)

Reviewed-by: Pavel Hrdina <phrdina at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20210215/bbb11395/attachment-0001.sig>


More information about the libvir-list mailing list