From patchwork Tue Dec 13 12:37:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 131065 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 893BBB6FF5 for ; Tue, 13 Dec 2011 23:38:06 +1100 (EST) Received: from localhost ([::1]:58122 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaRcQ-0004Px-45 for incoming@patchwork.ozlabs.org; Tue, 13 Dec 2011 07:38:02 -0500 Received: from eggs.gnu.org ([140.186.70.92]:44636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaRc6-00045S-Cf for qemu-devel@nongnu.org; Tue, 13 Dec 2011 07:37:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RaRc5-0004HE-5c for qemu-devel@nongnu.org; Tue, 13 Dec 2011 07:37:42 -0500 Received: from mail-yx0-f173.google.com ([209.85.213.173]:36775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaRc5-0004GM-2y for qemu-devel@nongnu.org; Tue, 13 Dec 2011 07:37:41 -0500 Received: by mail-yx0-f173.google.com with SMTP id m6so6316748yen.4 for ; Tue, 13 Dec 2011 04:37:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; bh=D/XleOpLiiOyJ5NdMJ49LuzqOQkE2tMh0l0s1cMvFoY=; b=DKGZpJFNq9kcOczNKBGyGxQTylB0XrUQlbe96uLnP5XGH2fwzzj9VthzYEWDH0hfK6 CFc+AHP8vKWw+rgWdjZrwiZjUdpwks/ZtYzA1FSaRibeMaPZaqKpnsL1xzJmJ5ris/VF lNl7+fet+R+K3Q5FFDMXebOeme7bn9Db4Ii7A= Received: by 10.236.177.5 with SMTP id c5mr3284559yhm.65.1323779860914; Tue, 13 Dec 2011 04:37:40 -0800 (PST) Received: from localhost.localdomain (93-34-178-147.ip50.fastwebnet.it. [93.34.178.147]) by mx.google.com with ESMTPS id i50sm35972917yhk.11.2011.12.13.04.37.39 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 13 Dec 2011 04:37:40 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 13 Dec 2011 13:37:09 +0100 Message-Id: <1323779840-4235-7-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.7.1 In-Reply-To: <1323779840-4235-1-git-send-email-pbonzini@redhat.com> References: <1323779840-4235-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.213.173 Subject: [Qemu-devel] [PATCH 06/17] block: move flag bits together 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Paolo Bonzini --- block_int.h | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-) diff --git a/block_int.h b/block_int.h index f846f90..9324866 100644 --- a/block_int.h +++ b/block_int.h @@ -192,15 +192,18 @@ struct BlockDriver { struct BlockDriverState { int64_t total_sectors; /* if we are reading a disk image, give its size in sectors */ - int read_only; /* if true, the media is read only */ - int keep_read_only; /* if true, the media was requested to stay read only */ int open_flags; /* flags used to open the file, re-used for re-open */ - int encrypted; /* if true, the media is encrypted */ - int valid_key; /* if true, a valid encryption key has been set */ - int sg; /* if true, the device is a /dev/sg* */ int copy_on_read; /* if true, copy read backing sectors into image note this is a reference count */ + unsigned read_only:1; /* if true, the media is read only */ + unsigned keep_read_only:1; /* if true, the media was requested to stay read only */ + unsigned encrypted:1; /* if true, the media is encrypted */ + unsigned valid_key:1; /* if true, a valid encryption key has been set */ + unsigned sg:1; /* if true, the device is a /dev/sg* */ + unsigned growable:1; /* if true, the disk can expand beyond total_sectors */ + unsigned is_temporary:1; /* if true, the disk was created from a snapshot */ + BlockDriver *drv; /* NULL means no media */ void *opaque; @@ -213,7 +216,6 @@ struct BlockDriverState { char backing_file[1024]; /* if non zero, the image is a diff of this file image */ char backing_format[16]; /* if non-zero and backing_file exists */ - int is_temporary; BlockDriverState *backing_hd; BlockDriverState *file; @@ -238,9 +240,6 @@ struct BlockDriverState { uint64_t total_time_ns[BDRV_MAX_IOTYPE]; uint64_t wr_highest_sector; - /* Whether the disk can expand beyond total_sectors */ - int growable; - /* the memory alignment required for the buffers handled by this driver */ int buffer_alignment;