From 0f124287dfb095601a98ac960cc2a8222e2738c9 Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <pbonzini@redhat.com>
Date: Wed, 22 Feb 2012 14:12:25 +0100
Subject: [PATCH 069/109] scsi: pass cdb to alloc_req

RH-Author: Paolo Bonzini <pbonzini@redhat.com>
Message-id: <1329919979-20948-69-git-send-email-pbonzini@redhat.com>
Patchwork-id: 37549
O-Subject: [RHEL 6.3 qemu-kvm PATCH v2 068/102] scsi: pass cdb to alloc_req
Bugzilla: 782029
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Orit Wasserman <owasserm@redhat.com>
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>

This will let scsi-block choose between passthrough and emulation.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from 63db0f0eee3c0b2cc3a06b36daf50c4e7801ea1b)
---
 hw/scsi-bus.c     |    2 +-
 hw/scsi-disk.c    |    4 ++--
 hw/scsi-generic.c |    2 +-
 hw/scsi.h         |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
---
 hw/scsi-bus.c     |    2 +-
 hw/scsi-disk.c    |    4 ++--
 hw/scsi-generic.c |    2 +-
 hw/scsi.h         |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index 117463c..fd41f42 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -454,7 +454,7 @@ SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun,
             req = scsi_req_alloc(&reqops_target_command, d, tag, lun,
                                  hba_private);
         } else {
-            req = d->info->alloc_req(d, tag, lun, hba_private);
+            req = d->info->alloc_req(d, tag, lun, buf, hba_private);
         }
     }
 
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index d4c6135..0b94f9e 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -1653,8 +1653,8 @@ static const SCSIReqOps scsi_disk_reqops = {
     .get_buf      = scsi_get_buf,
 };
 
-static SCSIRequest *scsi_new_request(SCSIDevice *d, uint32_t tag,
-                                     uint32_t lun, void *hba_private)
+static SCSIRequest *scsi_new_request(SCSIDevice *d, uint32_t tag, uint32_t lun,
+                                     uint8_t *buf, void *hba_private)
 {
     SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, d);
     SCSIRequest *req;
diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c
index ba8a416..be522e8 100644
--- a/hw/scsi-generic.c
+++ b/hw/scsi-generic.c
@@ -437,7 +437,7 @@ const SCSIReqOps scsi_generic_req_ops = {
 };
 
 static SCSIRequest *scsi_new_request(SCSIDevice *d, uint32_t tag, uint32_t lun,
-                                     void *hba_private)
+                                     uint8_t *buf, void *hba_private)
 {
     SCSIRequest *req;
 
diff --git a/hw/scsi.h b/hw/scsi.h
index 07357f3..86f3870 100644
--- a/hw/scsi.h
+++ b/hw/scsi.h
@@ -96,7 +96,7 @@ struct SCSIDeviceInfo {
     scsi_qdev_initfn init;
     void (*destroy)(SCSIDevice *s);
     SCSIRequest *(*alloc_req)(SCSIDevice *s, uint32_t tag, uint32_t lun,
-                              void *hba_private);
+                              uint8_t *buf, void *hba_private);
     void (*unit_attention_reported)(SCSIDevice *s);
 };
 
-- 
1.7.7.6

