diff options
author | Eric Blake <eblake@redhat.com> | 2016-06-23 16:37:26 -0600 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2016-07-05 16:46:26 +0200 |
commit | 5411541270f1d9e8eb1fb442fa4908c4398d5d88 (patch) | |
tree | 12d876f78a7e64b1ce98a05795b1f79653e1aa91 /block | |
parent | 8cc9c6e92bed8459bffaf5a22af8560f2cd8042b (diff) |
block: Use bool as appropriate for BDS members
Using int for values that are only used as booleans is confusing.
While at it, rearrange a couple of members so that all the bools
are contiguous.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/bochs.c | 2 | ||||
-rw-r--r-- | block/cloop.c | 2 | ||||
-rw-r--r-- | block/crypto.c | 4 | ||||
-rw-r--r-- | block/dmg.c | 2 | ||||
-rw-r--r-- | block/iscsi.c | 2 | ||||
-rw-r--r-- | block/qcow.c | 2 | ||||
-rw-r--r-- | block/qcow2.c | 2 | ||||
-rw-r--r-- | block/vvfat.c | 4 |
8 files changed, 10 insertions, 10 deletions
diff --git a/block/bochs.c b/block/bochs.c index 4194f1dd50..6427ad4fa2 100644 --- a/block/bochs.c +++ b/block/bochs.c @@ -104,7 +104,7 @@ static int bochs_open(BlockDriverState *bs, QDict *options, int flags, struct bochs_header bochs; int ret; - bs->read_only = 1; // no write support yet + bs->read_only = true; /* no write support yet */ ret = bdrv_pread(bs->file->bs, 0, &bochs, sizeof(bochs)); if (ret < 0) { diff --git a/block/cloop.c b/block/cloop.c index b5dc286685..8f046e1498 100644 --- a/block/cloop.c +++ b/block/cloop.c @@ -66,7 +66,7 @@ static int cloop_open(BlockDriverState *bs, QDict *options, int flags, uint32_t offsets_size, max_compressed_block_size = 1, i; int ret; - bs->read_only = 1; + bs->read_only = true; /* read header */ ret = bdrv_pread(bs->file->bs, 128, &s->block_size, 4); diff --git a/block/crypto.c b/block/crypto.c index 758e14e032..ec1f2474e2 100644 --- a/block/crypto.c +++ b/block/crypto.c @@ -322,8 +322,8 @@ static int block_crypto_open_generic(QCryptoBlockFormat format, goto cleanup; } - bs->encrypted = 1; - bs->valid_key = 1; + bs->encrypted = true; + bs->valid_key = true; ret = 0; cleanup: diff --git a/block/dmg.c b/block/dmg.c index 9612c21090..11a0673f33 100644 --- a/block/dmg.c +++ b/block/dmg.c @@ -438,7 +438,7 @@ static int dmg_open(BlockDriverState *bs, QDict *options, int flags, int64_t offset; int ret; - bs->read_only = 1; + bs->read_only = true; s->n_chunks = 0; s->offsets = s->lengths = s->sectors = s->sectorcounts = NULL; diff --git a/block/iscsi.c b/block/iscsi.c index b73fd0afe8..24f78a7755 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -1597,7 +1597,7 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags, * will try to read from the device to guess the image format. */ if (iscsilun->type != TYPE_DISK && iscsilun->type != TYPE_ROM) { - bs->sg = 1; + bs->sg = true; } task = iscsi_do_inquiry(iscsilun->iscsi, iscsilun->lun, 1, diff --git a/block/qcow.c b/block/qcow.c index 312af52816..e4175b8a86 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -174,7 +174,7 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags, goto fail; } - bs->encrypted = 1; + bs->encrypted = true; } s->cluster_bits = header.cluster_bits; s->cluster_size = 1 << s->cluster_bits; diff --git a/block/qcow2.c b/block/qcow2.c index fdf13cb781..017893181e 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -980,7 +980,7 @@ static int qcow2_open(BlockDriverState *bs, QDict *options, int flags, goto fail; } - bs->encrypted = 1; + bs->encrypted = true; } s->l2_bits = s->cluster_bits - 3; /* L2 is always one cluster */ diff --git a/block/vvfat.c b/block/vvfat.c index fc948cb863..55b5759a84 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -1158,7 +1158,7 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags, s->current_cluster=0xffffffff; /* read only is the default for safety */ - bs->read_only = 1; + bs->read_only = true; s->qcow = s->write_target = NULL; s->qcow_filename = NULL; s->fat2 = NULL; @@ -1174,7 +1174,7 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags, if (ret < 0) { goto fail; } - bs->read_only = 0; + bs->read_only = false; } bs->total_sectors = cyls * heads * secs; |