Re: [Qemu-devel] [PATCH 4/4] ISCSI: If the device we open is a SMC device, then force the use of sg. We dont have any medium changer emulation so only passthrough via real sg or scsi-generic via iscsi

2012-05-28 Thread Paolo Bonzini
Il 27/05/2012 15:12, Andreas Färber ha scritto:
  Modified to also do the same for tapes, applied to scsi-next branch for 
  1.2.
 Paolo, it seems you haven't pushed scsi-next since then.

Yeah, I have a pending push request for scsi-next, so I'm waiting till
Anthony applies it before pushing 1.2-only patches (I wasn't expecting
parallel 1.1/1.2 development for SCSI).

 I hope you've
 also shortened the subject to a humanly bearable length?

Yes. :)

Paolo



Re: [Qemu-devel] [PATCH 4/4] ISCSI: If the device we open is a SMC device, then force the use of sg. We dont have any medium changer emulation so only passthrough via real sg or scsi-generic via iscsi

2012-05-28 Thread ronnie sahlberg
Paolo


I think I have seen a problem inside libiscsi that could be triggered
by the shortcut.

Can you remove this shortcut completely :

-/* Try to write as much as we can to the socket
- * without setting up an event.
- * Only do this if we are completely logged in, so we know that
- * the socket is in connected state.
- */
-if (iscsi_is_logged_in(iscsi)) {
-if (iscsi_which_events(iscsi)  POLLOUT) {
-iscsi_process_write(iscsilun);
-}
-}

I think there is a problem inside libiscsi if the socket becomes full
and is no longer writeable and we try to write via this shortcurcuit.
It will take a while until I can verify or fix that issue and before a
new version of libiscsi can be available
so I would feel most comfortable with if we just remove this
optimization from QEMU for now.

It can be added back later once libiscsi is fixed.



regards
ronnie sahlberg


On Mon, May 28, 2012 at 4:48 PM, Paolo Bonzini pbonz...@redhat.com wrote:
 Il 27/05/2012 15:12, Andreas Färber ha scritto:
  Modified to also do the same for tapes, applied to scsi-next branch for 
  1.2.
 Paolo, it seems you haven't pushed scsi-next since then.

 Yeah, I have a pending push request for scsi-next, so I'm waiting till
 Anthony applies it before pushing 1.2-only patches (I wasn't expecting
 parallel 1.1/1.2 development for SCSI).

 I hope you've
 also shortened the subject to a humanly bearable length?

 Yes. :)

 Paolo



Re: [Qemu-devel] [PATCH 4/4] ISCSI: If the device we open is a SMC device, then force the use of sg. We dont have any medium changer emulation so only passthrough via real sg or scsi-generic via iscsi

2012-05-28 Thread Paolo Bonzini
Il 28/05/2012 13:55, ronnie sahlberg ha scritto:
 Paolo
 
 
 I think I have seen a problem inside libiscsi that could be triggered
 by the shortcut.
 
 Can you remove this shortcut completely :
 
 -/* Try to write as much as we can to the socket
 - * without setting up an event.
 - * Only do this if we are completely logged in, so we know that
 - * the socket is in connected state.
 - */
 -if (iscsi_is_logged_in(iscsi)) {
 -if (iscsi_which_events(iscsi)  POLLOUT) {
 -iscsi_process_write(iscsilun);
 -}
 -}
 
 I think there is a problem inside libiscsi if the socket becomes full
 and is no longer writeable and we try to write via this shortcurcuit.
 It will take a while until I can verify or fix that issue and before a
 new version of libiscsi can be available
 so I would feel most comfortable with if we just remove this
 optimization from QEMU for now.
 
 It can be added back later once libiscsi is fixed.

Done.  Rebased scsi-next, new commit is
f4dfa67f04037c1b1a8f4e4ddc944c5ab308f35b.

Paolo




Re: [Qemu-devel] [PATCH 4/4] ISCSI: If the device we open is a SMC device, then force the use of sg. We dont have any medium changer emulation so only passthrough via real sg or scsi-generic via iscsi

2012-05-27 Thread Andreas Färber
Am 26.05.2012 09:36, schrieb Paolo Bonzini:
 Il 26/05/2012 06:56, Ronnie Sahlberg ha scritto:
 Forcing sg also makes qemu skip trying to read from the device to guess the 
 image format by reading from the device (find_image_format()).
 SMC devices do not implement READ6/10/12/16  so it is noit possible to read 
 from them.

 With this patch I can successfully manage a SMC device wiht iscsi in 
 passthrough mode.

 Signed-off-by: Ronnie Sahlberg ronniesahlb...@gmail.com
[...]
 Modified to also do the same for tapes, applied to scsi-next branch for 1.2.

Paolo, it seems you haven't pushed scsi-next since then. I hope you've
also shortened the subject to a humanly bearable length?

Ronnie, please restrict commit message lines to at most 76 characters.
You can check by running `git log` in an 80-char-wide terminal. The
subject line is especially sensitive since this email subject is simply
unreadable. And Patchwork currently looks really ugly in WebKit due to
this patch subject.

https://live.gnome.org/Git/CommitMessages

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



Re: [Qemu-devel] [PATCH 4/4] ISCSI: If the device we open is a SMC device, then force the use of sg. We dont have any medium changer emulation so only passthrough via real sg or scsi-generic via iscsi

2012-05-26 Thread Paolo Bonzini
Il 26/05/2012 06:56, Ronnie Sahlberg ha scritto:
 Forcing sg also makes qemu skip trying to read from the device to guess the 
 image format by reading from the device (find_image_format()).
 SMC devices do not implement READ6/10/12/16  so it is noit possible to read 
 from them.
 
 With this patch I can successfully manage a SMC device wiht iscsi in 
 passthrough mode.
 
 Signed-off-by: Ronnie Sahlberg ronniesahlb...@gmail.com
 ---
  block/iscsi.c |9 +
  1 files changed, 9 insertions(+), 0 deletions(-)
 
 diff --git a/block/iscsi.c b/block/iscsi.c
 index a015a52..9ce38b5 100644
 --- a/block/iscsi.c
 +++ b/block/iscsi.c
 @@ -1032,6 +1032,15 @@ static int iscsi_open(BlockDriverState *bs, const char 
 *filename, int flags)
  if (iscsi_url != NULL) {
  iscsi_destroy_url(iscsi_url);
  }
 +
 +/* Medium changer. We dont have any emulation for this so this must
 +   be sg ioctl compatible. We force it to be sg, otherwise qemu will try
 +   to read from the device to guess the image format.
 + */
 +if (iscsilun-type == TYPE_MEDIUM_CHANGER) {
 +bs-sg = 1;
 +}
 +
  return 0;
  
  failed:

Modified to also do the same for tapes, applied to scsi-next branch for 1.2.

Paolo





[Qemu-devel] [PATCH 4/4] ISCSI: If the device we open is a SMC device, then force the use of sg. We dont have any medium changer emulation so only passthrough via real sg or scsi-generic via iscsi wou

2012-05-25 Thread Ronnie Sahlberg
Forcing sg also makes qemu skip trying to read from the device to guess the 
image format by reading from the device (find_image_format()).
SMC devices do not implement READ6/10/12/16  so it is noit possible to read 
from them.

With this patch I can successfully manage a SMC device wiht iscsi in 
passthrough mode.

Signed-off-by: Ronnie Sahlberg ronniesahlb...@gmail.com
---
 block/iscsi.c |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/block/iscsi.c b/block/iscsi.c
index a015a52..9ce38b5 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1032,6 +1032,15 @@ static int iscsi_open(BlockDriverState *bs, const char 
*filename, int flags)
 if (iscsi_url != NULL) {
 iscsi_destroy_url(iscsi_url);
 }
+
+/* Medium changer. We dont have any emulation for this so this must
+   be sg ioctl compatible. We force it to be sg, otherwise qemu will try
+   to read from the device to guess the image format.
+ */
+if (iscsilun-type == TYPE_MEDIUM_CHANGER) {
+bs-sg = 1;
+}
+
 return 0;
 
 failed:
-- 
1.7.3.1