[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 41/76] block/iscsi: change all iscsilun properties fr
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 41/76] block/iscsi: change all iscsilun properties from uint8_t to bool |
Date: |
Tue, 28 Apr 2015 17:00:23 +0200 |
From: Peter Lieven <address@hidden>
Signed-off-by: Peter Lieven <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/iscsi.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index be8af46..6cf7e99 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -57,9 +57,6 @@ typedef struct IscsiLun {
int events;
QEMUTimer *nop_timer;
QEMUTimer *event_timer;
- uint8_t lbpme;
- uint8_t lbprz;
- uint8_t has_write_same;
struct scsi_inquiry_logical_block_provisioning lbp;
struct scsi_inquiry_block_limits bl;
unsigned char *zeroblock;
@@ -67,6 +64,9 @@ typedef struct IscsiLun {
int cluster_sectors;
bool use_16_for_rw;
bool write_protected;
+ bool lbpme;
+ bool lbprz;
+ bool has_write_same;
} IscsiLun;
typedef struct IscsiTask {
@@ -460,7 +460,7 @@ static int64_t coroutine_fn
iscsi_co_get_block_status(BlockDriverState *bs,
*pnum = nb_sectors;
/* LUN does not support logical block provisioning */
- if (iscsilun->lbpme == 0) {
+ if (!iscsilun->lbpme) {
goto out;
}
@@ -1121,8 +1121,8 @@ static void iscsi_readcapacity_sync(IscsiLun *iscsilun,
Error **errp)
} else {
iscsilun->block_size = rc16->block_length;
iscsilun->num_blocks = rc16->returned_lba + 1;
- iscsilun->lbpme = rc16->lbpme;
- iscsilun->lbprz = rc16->lbprz;
+ iscsilun->lbpme = !!rc16->lbpme;
+ iscsilun->lbprz = !!rc16->lbprz;
iscsilun->use_16_for_rw = (rc16->returned_lba >
0xffffffff);
}
}
@@ -1655,7 +1655,7 @@ out:
static int iscsi_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
{
IscsiLun *iscsilun = bs->opaque;
- bdi->unallocated_blocks_are_zero = !!iscsilun->lbprz;
+ bdi->unallocated_blocks_are_zero = iscsilun->lbprz;
bdi->can_write_zeroes_with_unmap = iscsilun->lbprz && iscsilun->lbp.lbpws;
bdi->cluster_size = iscsilun->cluster_sectors * BDRV_SECTOR_SIZE;
return 0;
--
1.8.3.1
- [Qemu-block] [PULL 32/76] m25p80: add missing blk_attach_dev_nofail, (continued)
- [Qemu-block] [PULL 32/76] m25p80: add missing blk_attach_dev_nofail, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 30/76] block: avoid unnecessary bottom halves, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 33/76] m25p80: fix s->blk usage before assignment, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 34/76] block: document block-stream in qmp-commands.hx, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 35/76] block: add bdrv_get_device_or_node_name(), Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 36/76] block: use bdrv_get_device_or_node_name() in error messages, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 37/76] block: add 'node-name' field to BLOCK_IMAGE_CORRUPTED, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 38/76] Revert "hmp: fix crash in 'info block -n -v'", Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 39/76] qmp: fill in the image field in BlockDeviceInfo, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 40/76] block/iscsi: do not forget to logout from target, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 41/76] block/iscsi: change all iscsilun properties from uint8_t to bool,
Kevin Wolf <=
- [Qemu-block] [PULL 42/76] block/iscsi: rename iscsi_write_protected and let it return void, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 43/76] block/iscsi: store DPOFUA bit from the modesense command, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 44/76] block/iscsi: optimize WRITE10/16 if cache.writeback is not set, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 45/76] block/iscsi: increase retry count, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 46/76] block/iscsi: handle SCSI_STATUS_TASK_SET_FULL, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 47/76] block/iscsi: bump year in copyright notice, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 48/76] block/iscsi: use the allocationmap also if cache.direct=on, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 49/76] docs: incremental backup documentation, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 50/76] qapi: Add optional field "name" to block dirty bitmap, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 51/76] qmp: Ensure consistent granularity type, Kevin Wolf, 2015/04/28