From patchwork Mon Aug 30 16:53:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 63087 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 56F37B7100 for ; Tue, 31 Aug 2010 03:00:01 +1000 (EST) Received: from localhost ([127.0.0.1]:41866 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oq7hv-0003LT-Sn for incoming@patchwork.ozlabs.org; Mon, 30 Aug 2010 12:59:43 -0400 Received: from [140.186.70.92] (port=33826 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oq7cK-0001Tc-1G for qemu-devel@nongnu.org; Mon, 30 Aug 2010 12:53:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oq7cE-0001AU-Hm for qemu-devel@nongnu.org; Mon, 30 Aug 2010 12:53:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63874) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oq7cE-0001A5-BW for qemu-devel@nongnu.org; Mon, 30 Aug 2010 12:53:50 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7UGrmeu014517 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 30 Aug 2010 12:53:48 -0400 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7UGrfhZ014532; Mon, 30 Aug 2010 12:53:47 -0400 From: Kevin Wolf To: anthony@codemonkey.ws Date: Mon, 30 Aug 2010 18:53:51 +0200 Message-Id: <1283187233-3925-5-git-send-email-kwolf@redhat.com> In-Reply-To: <1283187233-3925-1-git-send-email-kwolf@redhat.com> References: <1283187233-3925-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [STABLE 0.13][PATCH 4/6] qemu-img rebase: Open new backing file read-only X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org We never write to a backing file, so opening rw is useless. It just means that you can't rebase on top of a file for which you don't have write permissions. Signed-off-by: Kevin Wolf (cherry picked from commit cdbae85169c384d1641aa1ae86cdeefe16285745) --- qemu-img.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index e300f91..d2a978b 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -1286,7 +1286,7 @@ static int img_rebase(int argc, char **argv) } bs_new_backing = bdrv_new("new_backing"); - ret = bdrv_open(bs_new_backing, out_baseimg, BDRV_O_FLAGS | BDRV_O_RDWR, + ret = bdrv_open(bs_new_backing, out_baseimg, BDRV_O_FLAGS, new_backing_drv); if (ret) { error("Could not open new backing file '%s'", out_baseimg);