[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'

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 the

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

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: 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.

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: