Re: [RFC] [PATCH] SCSI passthrough for virtio-blk

2008-08-29 Thread Christian Borntraeger
Thanks for your feedback. Here is a second try to allows to propagate scsi error code from host->guest. Makes sense? Signed-off-by: Christian Borntraeger <[EMAIL PROTECTED]> --- drivers/block/virtio_blk.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: kvm/drivers/block/virtio_

Re: [RFC] [PATCH] SCSI passthrough for virtio-blk

2008-08-29 Thread Christian Borntraeger
Am Freitag, 29. August 2008 schrieb Hannes Reinecke: > > ([<00435e66>] schedule+0x32e/0x7ec) > > [<0043659e>] schedule_timeout+0xba/0x10c > > [<004358da>] wait_for_common+0xbe/0x1a8 > > [<0027ec3e>] blk_execute_rq+0x86/0xc4 > > [<00282768>] sg_io+0x1a4/0x

Re: [RFC] [PATCH] SCSI passthrough for virtio-blk

2008-08-29 Thread Hannes Reinecke
Hi Christian, Christian Borntraeger wrote: Am Freitag, 29. August 2008 schrieb Hannes Reinecke: Hmm. Works here, using an unpatched kvm-73. Which version did you use? I use the s390 userspace prototype kuli which uses an virtio transport similar to lguest. I retried and it seems to race. M

Re: [RFC] [PATCH] SCSI passthrough for virtio-blk

2008-08-29 Thread Christian Borntraeger
Am Freitag, 29. August 2008 schrieb Hannes Reinecke: > Hmm. Works here, using an unpatched kvm-73. > Which version did you use? I use the s390 userspace prototype kuli which uses an virtio transport similar to lguest. I retried and it seems to race. Most of the time it works fine, but sometimes

Re: [RFC] [PATCH] SCSI passthrough for virtio-blk

2008-08-29 Thread Hannes Reinecke
Hi Christian, Christian Borntraeger wrote: Am Freitag, 29. August 2008 schrieb Hannes Reinecke: So when using '-drive file=/dev/sgXX,if=virtio,format=host_device' you can happily call any sg_XX command on the resulting vdX device. Quite neat, methinks. And it's even backwards compatible, so eac

Re: [RFC] [PATCH] SCSI passthrough for virtio-blk

2008-08-29 Thread Christian Borntraeger
Am Freitag, 29. August 2008 schrieb Hannes Reinecke: > So when using '-drive file=/dev/sgXX,if=virtio,format=host_device' you > can happily call any sg_XX command on the resulting vdX device. Quite > neat, methinks. And it's even backwards compatible, so each of these > patches should work without

[RFC] [PATCH] SCSI passthrough for virtio-blk

2008-08-29 Thread Hannes Reinecke
Hi all, I got bored and implemented SCSI passthrough for the virtio-blk driver. Principle is quite simple, just put the missing fields (cdb, sense and status header) on the virtio queue and then call the SG_IO ioctl on the host. So when using '-drive file=/dev/sgXX,if=virtio,format=host_device'