0a122b
From 4dfa4b8a0adf2ff3b5f48426e5f293d4ccaa86ce Mon Sep 17 00:00:00 2001
0a122b
From: Fam Zheng <famz@redhat.com>
0a122b
Date: Wed, 29 Jan 2014 05:09:21 +0100
0a122b
Subject: [PATCH 03/28] scsi: Support TEST UNIT READY in the dummy LUN0
0a122b
0a122b
RH-Author: Fam Zheng <famz@redhat.com>
0a122b
Message-id: <1390972161-27425-1-git-send-email-famz@redhat.com>
0a122b
Patchwork-id: 57014
0a122b
O-Subject: [RHEL-7 qemu-kvm PATCH] scsi: Support TEST UNIT READY in the dummy LUN0
0a122b
Bugzilla: 1004143
0a122b
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
0a122b
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
0a122b
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
0a122b
0a122b
From: Paolo Bonzini <pbonzini@redhat.com>
0a122b
0a122b
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1004143
0a122b
Brew:     http://brewweb.devel.redhat.com/brew/taskinfo?taskID=6965573
0a122b
0a122b
SeaBIOS waits for LUN0 to respond to the TEST UNIT READY command
0a122b
in order to decide whether it should part of the boot sequence.
0a122b
If LUN0 does not respond to the command, boot is delayed by up
0a122b
to 5 seconds.  This currently happens when there is no LUN0 on
0a122b
a target.  Fix that by adding a trivial implementation of the
0a122b
command.
0a122b
0a122b
Cc: qemu-stable@nongnu.org
0a122b
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
0a122b
(cherry picked from commit 1cb27d9233d572826b45bd8498d2fab1b6f01df9)
0a122b
Signed-off-by: Fam Zheng <famz@redhat.com>
0a122b
---
0a122b
 hw/scsi/scsi-bus.c | 2 ++
0a122b
 1 file changed, 2 insertions(+)
0a122b
0a122b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
0a122b
---
0a122b
 hw/scsi/scsi-bus.c |    2 ++
0a122b
 1 files changed, 2 insertions(+), 0 deletions(-)
0a122b
0a122b
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
0a122b
index 0f02208..a0fbf06 100644
0a122b
--- a/hw/scsi/scsi-bus.c
0a122b
+++ b/hw/scsi/scsi-bus.c
0a122b
@@ -461,6 +461,8 @@ static int32_t scsi_target_send_command(SCSIRequest *req, uint8_t *buf)
0a122b
             r->req.dev->sense_is_ua = false;
0a122b
         }
0a122b
         break;
0a122b
+    case TEST_UNIT_READY:
0a122b
+        break;
0a122b
     default:
0a122b
         scsi_req_build_sense(req, SENSE_CODE(LUN_NOT_SUPPORTED));
0a122b
         scsi_req_complete(req, CHECK_CONDITION);
0a122b
-- 
0a122b
1.7.1
0a122b