diff mbox

[QEMU-KVM] : Megasas + TCM_Loop + SG_IO into Windows XP guests

Message ID 1273786731.13658.49.camel@haakon2.linux-iscsi.org (mailing list archive)
State New, archived
Headers show

Commit Message

Nicholas A. Bellinger May 13, 2010, 9:38 p.m. UTC
None
diff mbox

Patch

diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c
index 6c58742..aa1eb83 100644
--- a/hw/scsi-generic.c
+++ b/hw/scsi-generic.c
@@ -140,6 +140,7 @@  static int execute_command_run(SCSIGenericReq *r,
 {
     BlockDriverState *bdrv = r->req.dev->conf.dinfo->bdrv;
     SCSIGenericState *s = DO_UPCAST(SCSIGenericState, qdev, r->req.dev);
+    int ret;
 
     r->io_header.interface_id = 'S';
     r->io_header.dxfer_direction = sgdir[r->req.cmd.mode];
@@ -161,11 +162,16 @@  static int execute_command_run(SCSIGenericReq *r,
     printf("\n");
     }
 #endif
+#if 0
     r->req.aiocb = bdrv_aio_ioctl(bdrv, SG_IO, &r->io_header, complete, r);
     if (r->req.aiocb == NULL) {
         BADF("execute_command: read failed !\n");
         return -1;
     }
+#else
+    ret = bdrv_ioctl(bdrv, SG_IO, &r->io_header);
+    complete((void *)r, ret);
+#endif
 
      *      return 0;
 }