qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Fix -snapshot deleting images on disk change


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH] Fix -snapshot deleting images on disk change
Date: Mon, 26 Jul 2010 08:58:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Blue Swirl <address@hidden> writes:

> Block device change command did not copy BDRV_O_SNAPSHOT flag. Thus
> the new image did not have this flag and the file got deleted during
> opening.
>
> Fix by copying BDRV_O_SNAPSHOT flag.

Aha: the file gets deleted because bs->is_temporary survives change, but
BDRV_O_SNAPSHOT does not.  Thus, the new image gets opened without a
snapshot file wrapped around it.  But since is_temporary is still true,
we attempt to delete the (nonexistant) snapshot file, and end up
deleting the image file instead.

Your fix makes sense.  But I recommend to additionally set
bs->is_temporary unconditionally in bdrv_open().  Or get rid of it and
test bs->open_flags instead.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]