From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 4/4] iscsi: always query max WRITE SAME length
Date: Thu, 3 Apr 2014 13:12:21 +0200 [thread overview]
Message-ID: <1396523541-568-5-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1396523541-568-1-git-send-email-pbonzini@redhat.com>
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
next prev parent reply other threads:[~2014-04-03 11:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Paolo Bonzini [this message]
2014-04-03 12:03 ` [Qemu-devel] [PULL for-2.0 0/4] SCSI changes for QEMU 2.0 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1396523541-568-5-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).