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: 8226321 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7C2289F1C0 for ; Thu, 4 Feb 2016 17:36:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DE2A720395 for ; Thu, 4 Feb 2016 17:36:02 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BA0EE20122 for ; Thu, 4 Feb 2016 17:36:01 +0000 (UTC) Received: from localhost ([::1]:43273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRNp2-0003fs-Is for patchwork-qemu-devel@patchwork.kernel.org; Thu, 04 Feb 2016 12:36:00 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;