qcow2: Fix header update with overridden backing file
commite4603fe139e2161464d7e75faa3a650e31f057fc
authorKevin Wolf <kwolf@redhat.com>
Tue, 7 Apr 2015 13:03:16 +0000 (7 15:03 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 8 Apr 2015 09:29:20 +0000 (8 10:29 +0100)
tree7c0ccd7b76830684ed8a6f3a5f5219f2d542e700
parent5a24f20a7208a58fb80d78ca0521bba6f4d7b145
qcow2: Fix header update with overridden backing file

In recent qemu versions, it is possible to override the backing file
name and format that is stored in the image file with values given at
runtime. In such cases, the temporary override could end up in the
image header if the qcow2 header was updated, while obviously correct
behaviour would be to leave the on-disk backing file path/format
unchanged.

Fix this and add a test case for it.

Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1428411796-2852-1-git-send-email-kwolf@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/qcow2.c
block/qcow2.h
tests/qemu-iotests/130 [new file with mode: 0755]
tests/qemu-iotests/130.out [new file with mode: 0644]
tests/qemu-iotests/group