diff mbox

[06/17] block: move flag bits together

Message ID 1323779840-4235-7-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini Dec. 13, 2011, 12:37 p.m. UTC
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 block_int.h |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)
diff mbox

Patch

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;