From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59934) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRlm7-0007gz-Oa for qemu-devel@nongnu.org; Tue, 08 May 2012 10:52:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SRlm4-0007UC-Ai for qemu-devel@nongnu.org; Tue, 08 May 2012 10:52:27 -0400 Received: from mail-pz0-f47.google.com ([209.85.210.47]:52083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRlm4-0007Sn-2J for qemu-devel@nongnu.org; Tue, 08 May 2012 10:52:24 -0400 Received: by mail-pz0-f47.google.com with SMTP id h21so8313251dal.34 for ; Tue, 08 May 2012 07:52:23 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 8 May 2012 16:51:42 +0200 Message-Id: <1336488722-13120-3-git-send-email-pbonzini@redhat.com> In-Reply-To: <1336488722-13120-1-git-send-email-pbonzini@redhat.com> References: <1336488722-13120-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 1.1 02/22] block: another bdrv_append fix List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@linux.vnet.ibm.com bdrv_append must also copy open_flags to the top, because the snapshot has BDRV_O_NO_BACKING set. This causes interesting results if you later use drive-reopen (not upstream) to reopen the image, and lose the backing file in the process. Signed-off-by: Paolo Bonzini --- block.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block.c b/block.c index 87600a5..6dc0d44 100644 --- a/block.c +++ b/block.c @@ -977,6 +977,7 @@ void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top) tmp = *bs_new; /* there are some fields that need to stay on the top layer: */ + tmp.open_flags = bs_top->open_flags; /* dev info */ tmp.dev_ops = bs_top->dev_ops; -- 1.7.10.1