From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ljg6H-0006WM-H9 for qemu-devel@nongnu.org; Tue, 17 Mar 2009 16:41:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ljg6C-0006TQ-FA for qemu-devel@nongnu.org; Tue, 17 Mar 2009 16:41:24 -0400 Received: from [199.232.76.173] (port=57244 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ljg6C-0006TK-80 for qemu-devel@nongnu.org; Tue, 17 Mar 2009 16:41:20 -0400 Received: from mx1.redhat.com ([66.187.233.31]:45049) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ljg6B-0004KB-S6 for qemu-devel@nongnu.org; Tue, 17 Mar 2009 16:41:20 -0400 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n2HKfJ2X020347 for ; Tue, 17 Mar 2009 16:41:19 -0400 From: Uri Lublin Date: Tue, 17 Mar 2009 22:40:51 +0200 Message-Id: <1237322452-11337-14-git-send-email-uril@redhat.com> In-Reply-To: <1237322452-11337-13-git-send-email-uril@redhat.com> References: <1237322452-11337-1-git-send-email-uril@redhat.com> <1237322452-11337-2-git-send-email-uril@redhat.com> <1237322452-11337-3-git-send-email-uril@redhat.com> <1237322452-11337-4-git-send-email-uril@redhat.com> <1237322452-11337-5-git-send-email-uril@redhat.com> <1237322452-11337-6-git-send-email-uril@redhat.com> <1237322452-11337-7-git-send-email-uril@redhat.com> <1237322452-11337-8-git-send-email-uril@redhat.com> <1237322452-11337-9-git-send-email-uril@redhat.com> <1237322452-11337-10-git-send-email-uril@redhat.com> <1237322452-11337-11-git-send-email-uril@redhat.com> <1237322452-11337-12-git-send-email-uril@redhat.com> <1237322452-11337-13-git-send-email-uril@redhat.com> Subject: [Qemu-devel] [PATCH 13/14] block: keep flags an image was opened with Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Uri Lublin Can be used to close and reopen images. Can be used to check if BDRV_O_BACKING is on (a backing file). Keep it in a single place instead of keeping it in two places (also in block-qcow2.c) Signed-off-by: Uri Lublin --- block.c | 2 ++ block_int.h | 2 ++ 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/block.c b/block.c index 8d92d9e..a938ed7 100644 --- a/block.c +++ b/block.c @@ -358,6 +358,8 @@ int bdrv_open2(BlockDriverState *bs, const char *filename, int flags, bs->encrypted = 0; bs->valid_key = 0; + bs->open_flags = flags; + if (flags & BDRV_O_SNAPSHOT) { BlockDriverState *bs1; int64_t total_size; diff --git a/block_int.h b/block_int.h index 2206178..715bbad 100644 --- a/block_int.h +++ b/block_int.h @@ -124,6 +124,8 @@ struct BlockDriverState { int is_temporary; int media_changed; + int open_flags; /* flags the image was opened with */ + BlockDriverState *backing_hd; /* async read/write emulation */ -- 1.6.0.6