qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [patch] fix scsi-generic
@ 2010-08-07  0:55 adq
  2010-08-07  1:50 ` [Qemu-devel] " adq
  2010-08-08 13:11 ` [Qemu-devel] " Kevin Wolf
  0 siblings, 2 replies; 12+ messages in thread
From: adq @ 2010-08-07  0:55 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1098 bytes --]

Hi, I've been tracking down why scsi generic devices (using SG_IO)
don't work any more. After adding debug, I can see that it actually
submits the scsi CDB in hw/scsi-generic.c/execute_command(), but that
the hw/scsi-generic.c/scsi_read_complete() callback is never called.

This is because these are done with ioctls, and the posix async ioctl
code is, I think, broken right now. Some more debugging, led me to
posix-aio-compat.c/posix_aio_process_queue():

            if (acb->async_context_id != async_context_id) {

The async_context_ids don't match, so the request is never handled.
This is because the acb->async_context_id field is not initialised in
posix-aio-compat.c/paio_ioctl() (compare with
posix-aio-compat.c/paio_submit()). The attached patch adds the missing
line in.

This seems to fix the problem. Of course, /now/ I'm getting other
weird problems (as I'm trying to see if I can get slysoft anydvd
working in a KVM winXP vm), but they need further investigation and
likely other fixes.

Please forgive me if I'm mistaken in this, I've only just started
looking at the qemu code.

[-- Attachment #2: posix-aio-ioctl-async-context-id.patch --]
[-- Type: text/x-patch, Size: 498 bytes --]

diff -Naur qemu-kvm-0.12.5.orig//posix-aio-compat.c qemu-kvm-0.12.5/posix-aio-compat.c
--- qemu-kvm-0.12.5.orig//posix-aio-compat.c	2010-07-27 01:43:53.000000000 +0100
+++ qemu-kvm-0.12.5/posix-aio-compat.c	2010-08-07 01:49:07.051265778 +0100
@@ -597,6 +597,7 @@
     acb->aio_type = QEMU_AIO_IOCTL;
     acb->aio_fildes = fd;
     acb->ev_signo = SIGUSR2;
+    acb->async_context_id = get_async_context_id();
     acb->aio_offset = 0;
     acb->aio_ioctl_buf = buf;
     acb->aio_ioctl_cmd = req;

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-11-19  2:07 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-07  0:55 [Qemu-devel] [patch] fix scsi-generic adq
2010-08-07  1:50 ` [Qemu-devel] " adq
2010-08-07  2:03   ` adq
2010-08-08 13:11 ` [Qemu-devel] " Kevin Wolf
2010-08-08 20:08   ` adq
2010-08-08 22:13     ` adq
2010-08-08 23:51       ` adq
2010-11-12 10:00         ` [Qemu-devel] " Paolo Bonzini
2010-11-17 22:53           ` adq
2010-11-17 23:33             ` adq
2010-11-19  2:07               ` adq
2010-08-30 13:16     ` [Qemu-devel] " Kevin Wolf

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