From patchwork Mon Aug 30 16:32:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 63084 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 97293B70CD for ; Tue, 31 Aug 2010 02:52:26 +1000 (EST) Received: from localhost ([127.0.0.1]:42988 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oq7aQ-0000AF-FG for incoming@patchwork.ozlabs.org; Mon, 30 Aug 2010 12:51:58 -0400 Received: from [140.186.70.92] (port=42289 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oq7Jh-0001kZ-7D for qemu-devel@nongnu.org; Mon, 30 Aug 2010 12:34:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oq7Ha-00053q-6B for qemu-devel@nongnu.org; Mon, 30 Aug 2010 12:32:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4039) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oq7HZ-00053e-Vi for qemu-devel@nongnu.org; Mon, 30 Aug 2010 12:32:30 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7UGWRbE010913 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 30 Aug 2010 12:32:28 -0400 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7UGWKtf029322; Mon, 30 Aug 2010 12:32:26 -0400 From: Kevin Wolf To: anthony@codemonkey.ws Date: Mon, 30 Aug 2010 18:32:28 +0200 Message-Id: <1283185953-30639-6-git-send-email-kwolf@redhat.com> In-Reply-To: <1283185953-30639-1-git-send-email-kwolf@redhat.com> References: <1283185953-30639-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 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] [PATCH 05/10] 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 --- 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);