Description of problem:
Created the snapshot chain as base -> sn1 -> sn2. Boot guest with the created image and created temporary files fbase, fsn1, and fsn2 in turn. Commit the changes of sn2 to the base image. Found the temporary files in the guest are changed as below:
base: fbase, fsn1, and fsn2
sn1: fbase, and fsn1
sn2: fbase, fsn1, and fsn2
Checked the scenario with Max(@mreitz), it is expected. But I think below statement explained by Max should be added to the qemu-img manpage. It will help to create a better understanding of the feature.
> If you commit the changes from an image into one in its backing chain,
> all of the intermediate images become obsolete and actually invalid.
> Therefore, in this case, sn1 may no longer be used after the commit
Date: Thu, 26 Oct 2017 09:59:47 +0200
From: Max Reitz <email@example.com>
Subject: [Qemu-devel] [PATCH] qemu-img.1: Image invalidation on qemu-img commit
Cc: Kevin Wolf <firstname.lastname@example.org>, email@example.com, Max Reitz <firstname.lastname@example.org>
qemu-img commit invalidates all images between base and top. This
should be mentioned in the man page.
Suggested-by: Ping Li <email@example.com>
Signed-off-by: Max Reitz <firstname.lastname@example.org>
qemu-img.texi | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
Checked the manpage, found below descriptions were added.
Note that after a commit operation all images between
base and the top image will be invalid and may return garbage
data when read. For this reason, "-b" implies "-d" (so that the
top image stays valid).
Set the bug as verified.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.