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 Date: Thu, 4 Feb 2016 17:36:39 +0000 From: Alyssa Milburn Message-ID: <20160204173639.GA5772@li141-249.members.linode.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] blockdev: Unset temporary flag when changing medium. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Markus Armbruster , qemu-block@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; -- 2.1.0