From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfT8k-00039x-Cm for qemu-devel@nongnu.org; Tue, 07 Apr 2015 09:02:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YfT8e-0001W4-Kv for qemu-devel@nongnu.org; Tue, 07 Apr 2015 09:02:02 -0400 Date: Tue, 7 Apr 2015 15:01:46 +0200 From: Kevin Wolf Message-ID: <20150407130146.GG4635@noname.str.redhat.com> References: <1428411078-536-1-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1428411078-536-1-git-send-email-kwolf@redhat.com> Subject: Re: [Qemu-devel] [PATCH for-2.3] qcow2: Fix header update with overridden backing file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: mjt@tls.msk.ru, qemu-devel@nongnu.org, stefanha@redhat.com Am 07.04.2015 um 14:51 hat Kevin Wolf geschrieben: > 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 > Signed-off-by: Kevin Wolf > --- 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; *sigh* I guess freeing these in qcow2_close() wouldn't hurt either. Sending v2. Kevin