diff options
author | Kevin Wolf <kwolf@redhat.com> | 2015-04-07 15:03:16 +0200 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2015-04-08 10:29:20 +0100 |
commit | e4603fe139e2161464d7e75faa3a650e31f057fc (patch) | |
tree | 7c0ccd7b76830684ed8a6f3a5f5219f2d542e700 /block/qcow2.h | |
parent | 5a24f20a7208a58fb80d78ca0521bba6f4d7b145 (diff) |
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>
Diffstat (limited to 'block/qcow2.h')
-rw-r--r-- | block/qcow2.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/block/qcow2.h b/block/qcow2.h index aa6d367818..422b825138 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -283,6 +283,12 @@ typedef struct BDRVQcowState { QLIST_HEAD(, Qcow2UnknownHeaderExtension) unknown_header_ext; QTAILQ_HEAD (, Qcow2DiscardRegion) discards; bool cache_discards; + + /* Backing file path and format as stored in the image (this is not the + * effective path/format, which may be the result of a runtime option + * override) */ + char *image_backing_file; + char *image_backing_format; } BDRVQcowState; struct QCowAIOCB; |