[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 42/76] block/iscsi: rename iscsi_write_protected and
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 42/76] block/iscsi: rename iscsi_write_protected and let it return void |
Date: |
Tue, 28 Apr 2015 17:00:24 +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 | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index 6cf7e99..221c9fc 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1253,11 +1253,11 @@ static void iscsi_attach_aio_context(BlockDriverState
*bs,
iscsi_timed_set_events, iscsilun);
}
-static bool iscsi_is_write_protected(IscsiLun *iscsilun)
+static void iscsi_modesense_sync(IscsiLun *iscsilun)
{
struct scsi_task *task;
struct scsi_mode_sense *ms = NULL;
- bool wrprotected = false;
+ iscsilun->write_protected = false;
task = iscsi_modesense6_sync(iscsilun->iscsi, iscsilun->lun,
1, SCSI_MODESENSE_PC_CURRENT,
@@ -1278,13 +1278,12 @@ static bool iscsi_is_write_protected(IscsiLun *iscsilun)
iscsi_get_error(iscsilun->iscsi));
goto out;
}
- wrprotected = ms->device_specific_parameter & 0x80;
+ iscsilun->write_protected = ms->device_specific_parameter & 0x80;
out:
if (task) {
scsi_free_scsi_task(task);
}
- return wrprotected;
}
/*
@@ -1403,7 +1402,8 @@ static int iscsi_open(BlockDriverState *bs, QDict
*options, int flags,
scsi_free_scsi_task(task);
task = NULL;
- iscsilun->write_protected = iscsi_is_write_protected(iscsilun);
+ iscsi_modesense_sync(iscsilun);
+
/* Check the write protect flag of the LUN if we want to write */
if (iscsilun->type == TYPE_DISK && (flags & BDRV_O_RDWR) &&
iscsilun->write_protected) {
--
1.8.3.1
- [Qemu-block] [PULL 30/76] block: avoid unnecessary bottom halves, (continued)
- [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, 2015/04/28
- [Qemu-block] [PULL 42/76] block/iscsi: rename iscsi_write_protected and let it return void,
Kevin Wolf <=
- [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
- [Qemu-block] [PULL 52/76] qmp: Add block-dirty-bitmap-add and block-dirty-bitmap-remove, Kevin Wolf, 2015/04/28