* [Qemu-devel] [PULL for-2.0 0/4] SCSI changes for QEMU 2.0
@ 2014-04-03 11:12 Paolo Bonzini
2014-04-03 11:12 ` [Qemu-devel] [PULL 1/4] scsi-bus: remove bogus assertion Paolo Bonzini
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Paolo Bonzini @ 2014-04-03 11:12 UTC (permalink / raw)
To: qemu-devel
The following changes since commit 63678e17cf399ff81b93417fe7bee8d6ef6b6b1b:
configure: add option to disable -fstack-protector flags (2014-03-31 20:16:02 +0100)
are available in the git repository at:
git://github.com/bonzini/qemu.git scsi-next
for you to fetch changes up to c97ca29db0a68deb281a901f535cec5ea4862244:
iscsi: always query max WRITE SAME length (2014-04-03 13:10:53 +0200)
----------------------------------------------------------------
Paolo Bonzini (4):
scsi-bus: remove bogus assertion
iscsi: recognize "invalid field" ASCQ from WRITE SAME command
iscsi: ignore flushes on scsi-generic devices
iscsi: always query max WRITE SAME length
block/iscsi.c | 19 +++++++++++++------
hw/scsi/scsi-bus.c | 1 -
2 files changed, 13 insertions(+), 7 deletions(-)
--
1.9.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 1/4] scsi-bus: remove bogus assertion
2014-04-03 11:12 [Qemu-devel] [PULL for-2.0 0/4] SCSI changes for QEMU 2.0 Paolo Bonzini
@ 2014-04-03 11:12 ` Paolo Bonzini
2014-04-03 11:12 ` [Qemu-devel] [PULL 2/4] iscsi: recognize "invalid field" ASCQ from WRITE SAME command Paolo Bonzini
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2014-04-03 11:12 UTC (permalink / raw)
To: qemu-devel
This assertion is invalid, because get_sg_list can return an
empty sg-list even for commands that transfer no data (such
as SYNCHRONIZE CACHE).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/scsi/scsi-bus.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
index eaad925..ae921a6 100644
--- a/hw/scsi/scsi-bus.c
+++ b/hw/scsi/scsi-bus.c
@@ -101,7 +101,6 @@ static void scsi_dma_restart_bh(void *opaque)
scsi_req_continue(req);
break;
case SCSI_XFER_NONE:
- assert(!req->sg);
scsi_req_dequeue(req);
scsi_req_enqueue(req);
break;
--
1.9.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 2/4] iscsi: recognize "invalid field" ASCQ from WRITE SAME command
2014-04-03 11:12 [Qemu-devel] [PULL for-2.0 0/4] SCSI changes for QEMU 2.0 Paolo Bonzini
2014-04-03 11:12 ` [Qemu-devel] [PULL 1/4] scsi-bus: remove bogus assertion Paolo Bonzini
@ 2014-04-03 11:12 ` Paolo Bonzini
2014-04-03 11:12 ` [Qemu-devel] [PULL 3/4] iscsi: ignore flushes on scsi-generic devices Paolo Bonzini
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2014-04-03 11:12 UTC (permalink / raw)
To: qemu-devel
Some targets may return "invalid field" as the ASCQ from WRITE SAME
if they support the command only without the UNMAP field. Recognize
that, and return ENOTSUP just like for "invalid operation code".
Reviewed-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
block/iscsi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index b490e98..2f96a8e 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -838,7 +838,8 @@ retry:
if (iTask.status == SCSI_STATUS_CHECK_CONDITION &&
iTask.task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST &&
- iTask.task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) {
+ (iTask.task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE ||
+ iTask.task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_FIELD_IN_CDB)) {
/* WRITE SAME is not supported by the target */
iscsilun->has_write_same = false;
scsi_free_scsi_task(iTask.task);
--
1.9.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 3/4] iscsi: ignore flushes on scsi-generic devices
2014-04-03 11:12 [Qemu-devel] [PULL for-2.0 0/4] SCSI changes for QEMU 2.0 Paolo Bonzini
2014-04-03 11:12 ` [Qemu-devel] [PULL 1/4] scsi-bus: remove bogus assertion Paolo Bonzini
2014-04-03 11:12 ` [Qemu-devel] [PULL 2/4] iscsi: recognize "invalid field" ASCQ from WRITE SAME command Paolo Bonzini
@ 2014-04-03 11:12 ` Paolo Bonzini
2014-04-03 11:12 ` [Qemu-devel] [PULL 4/4] iscsi: always query max WRITE SAME length Paolo Bonzini
2014-04-03 12:03 ` [Qemu-devel] [PULL for-2.0 0/4] SCSI changes for QEMU 2.0 Peter Maydell
4 siblings, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2014-04-03 11:12 UTC (permalink / raw)
To: qemu-devel
Non-block SCSI devices do not support flushing, but we may still send
them requests via bdrv_flush_all. Just ignore them.
Reviewed-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
block/iscsi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/block/iscsi.c b/block/iscsi.c
index 2f96a8e..e68aa0f 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -417,6 +417,10 @@ static int coroutine_fn iscsi_co_flush(BlockDriverState *bs)
IscsiLun *iscsilun = bs->opaque;
struct IscsiTask iTask;
+ if (bs->sg) {
+ return 0;
+ }
+
iscsi_co_init_iscsitask(iscsilun, &iTask);
retry:
--
1.9.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 4/4] iscsi: always query max WRITE SAME length
2014-04-03 11:12 [Qemu-devel] [PULL for-2.0 0/4] SCSI changes for QEMU 2.0 Paolo Bonzini
` (2 preceding siblings ...)
2014-04-03 11:12 ` [Qemu-devel] [PULL 3/4] iscsi: ignore flushes on scsi-generic devices Paolo Bonzini
@ 2014-04-03 11:12 ` Paolo Bonzini
2014-04-03 12:03 ` [Qemu-devel] [PULL for-2.0 0/4] SCSI changes for QEMU 2.0 Peter Maydell
4 siblings, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2014-04-03 11:12 UTC (permalink / raw)
To: qemu-devel
Max WRITE SAME length is also used when the UNMAP bit is zero, so it
should be queried even if LBPWS=0. Same for the optimal transfer
length.
However, the write_zeroes_alignment only matters for UNMAP=1 so we
still restrict it to LBPWS=1.
Reviewed-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
block/iscsi.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index e68aa0f..21c18a3 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1335,18 +1335,20 @@ static int iscsi_refresh_limits(BlockDriverState *bs)
/* We don't actually refresh here, but just return data queried in
* iscsi_open(): iscsi targets don't change their limits. */
- if (iscsilun->lbp.lbpu || iscsilun->lbp.lbpws) {
+ if (iscsilun->lbp.lbpu) {
if (iscsilun->bl.max_unmap < 0xffffffff) {
bs->bl.max_discard = sector_lun2qemu(iscsilun->bl.max_unmap,
iscsilun);
}
bs->bl.discard_alignment = sector_lun2qemu(iscsilun->bl.opt_unmap_gran,
iscsilun);
+ }
- if (iscsilun->bl.max_ws_len < 0xffffffff) {
- bs->bl.max_write_zeroes = sector_lun2qemu(iscsilun->bl.max_ws_len,
- iscsilun);
- }
+ if (iscsilun->bl.max_ws_len < 0xffffffff) {
+ bs->bl.max_write_zeroes = sector_lun2qemu(iscsilun->bl.max_ws_len,
+ iscsilun);
+ }
+ if (iscsilun->lbp.lbpws) {
bs->bl.write_zeroes_alignment = sector_lun2qemu(iscsilun->bl.opt_unmap_gran,
iscsilun);
}
--
1.9.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PULL for-2.0 0/4] SCSI changes for QEMU 2.0
2014-04-03 11:12 [Qemu-devel] [PULL for-2.0 0/4] SCSI changes for QEMU 2.0 Paolo Bonzini
` (3 preceding siblings ...)
2014-04-03 11:12 ` [Qemu-devel] [PULL 4/4] iscsi: always query max WRITE SAME length Paolo Bonzini
@ 2014-04-03 12:03 ` Peter Maydell
4 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2014-04-03 12:03 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: QEMU Developers
On 3 April 2014 12:12, Paolo Bonzini <pbonzini@redhat.com> wrote:
> The following changes since commit 63678e17cf399ff81b93417fe7bee8d6ef6b6b1b:
>
> configure: add option to disable -fstack-protector flags (2014-03-31 20:16:02 +0100)
>
> are available in the git repository at:
>
> git://github.com/bonzini/qemu.git scsi-next
>
> for you to fetch changes up to c97ca29db0a68deb281a901f535cec5ea4862244:
>
> iscsi: always query max WRITE SAME length (2014-04-03 13:10:53 +0200)
>
> ----------------------------------------------------------------
> Paolo Bonzini (4):
> scsi-bus: remove bogus assertion
> iscsi: recognize "invalid field" ASCQ from WRITE SAME command
> iscsi: ignore flushes on scsi-generic devices
> iscsi: always query max WRITE SAME length
>
> block/iscsi.c | 19 +++++++++++++------
> hw/scsi/scsi-bus.c | 1 -
> 2 files changed, 13 insertions(+), 7 deletions(-)
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-04-03 12:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-03 11:12 [Qemu-devel] [PULL for-2.0 0/4] SCSI changes for QEMU 2.0 Paolo Bonzini
2014-04-03 11:12 ` [Qemu-devel] [PULL 1/4] scsi-bus: remove bogus assertion Paolo Bonzini
2014-04-03 11:12 ` [Qemu-devel] [PULL 2/4] iscsi: recognize "invalid field" ASCQ from WRITE SAME command Paolo Bonzini
2014-04-03 11:12 ` [Qemu-devel] [PULL 3/4] iscsi: ignore flushes on scsi-generic devices Paolo Bonzini
2014-04-03 11:12 ` [Qemu-devel] [PULL 4/4] iscsi: always query max WRITE SAME length Paolo Bonzini
2014-04-03 12:03 ` [Qemu-devel] [PULL for-2.0 0/4] SCSI changes for QEMU 2.0 Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).