From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59773) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSRsY-0001CB-Q4 for qemu-devel@nongnu.org; Thu, 10 May 2012 07:49:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSRsW-0006Ep-Pu for qemu-devel@nongnu.org; Thu, 10 May 2012 07:49:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSRsW-0006E4-7E for qemu-devel@nongnu.org; Thu, 10 May 2012 07:49:52 -0400 From: Kevin Wolf Date: Thu, 10 May 2012 13:49:16 +0200 Message-Id: <1336650574-12835-13-git-send-email-kwolf@redhat.com> In-Reply-To: <1336650574-12835-1-git-send-email-kwolf@redhat.com> References: <1336650574-12835-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 12/30] block: another bdrv_append fix List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Paolo Bonzini 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 Signed-off-by: Kevin Wolf --- block.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) 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.6.5