From patchwork Thu Feb 4 17:36:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alyssa Milburn X-Patchwork-Id: 579063 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 28DCE140CAD for ; Fri, 5 Feb 2016 04:36:16 +1100 (AEDT) Received: from localhost ([::1]:43278 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRNpG-0004Dx-7S for incoming@patchwork.ozlabs.org; Thu, 04 Feb 2016 12:36:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRNom-0003cy-0y for qemu-devel@nongnu.org; Thu, 04 Feb 2016 12:35:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRNok-0001m6-Nw for qemu-devel@nongnu.org; Thu, 04 Feb 2016 12:35:43 -0500 Received: from li141-249.members.linode.com ([109.74.194.249]:45311) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRNof-0001jl-Pz; Thu, 04 Feb 2016 12:35:37 -0500 Received: by li141-249.members.linode.com (Postfix, from userid 1000) id 4A4B379DA; Thu, 4 Feb 2016 17:36:39 +0000 (UTC) Date: Thu, 4 Feb 2016 17:36:39 +0000 From: Alyssa Milburn To: qemu-devel@nongnu.org Message-ID: <20160204173639.GA5772@li141-249.members.linode.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 109.74.194.249 Cc: Kevin Wolf , Markus Armbruster , qemu-block@nongnu.org Subject: [Qemu-devel] [PATCH] blockdev: Unset temporary flag when changing medium. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This avoids a 'change' command from the monitor unlink()ing the new file if the bdrv was previously snapshotted. Signed-off-by: Alyssa Milburn --- blockdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/blockdev.c b/blockdev.c index be4ca44..d39c2e6 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2514,6 +2514,7 @@ void qmp_blockdev_change_medium(const char *device, const char *filename, } bdrv_flags = blk_get_open_flags_from_root_state(blk); + bdrv_flags &= ~BDRV_O_TEMPORARY; if (!has_read_only) { read_only = BLOCKDEV_CHANGE_READ_ONLY_MODE_RETAIN;