Blame SOURCES/kvm-scsi-Fix-onboard-HBAs-to-pick-up-drive-if-scsi.patch

4a2fec
From 8198d8d36fed85743c4d2b26aa1670f5bc3a9793 Mon Sep 17 00:00:00 2001
4a2fec
From: Markus Armbruster <armbru@redhat.com>
4a2fec
Date: Tue, 28 Nov 2017 13:24:17 +0100
4a2fec
Subject: [PATCH 16/21] scsi: Fix onboard HBAs to pick up -drive if=scsi
4a2fec
4a2fec
RH-Author: Markus Armbruster <armbru@redhat.com>
4a2fec
Message-id: <20171128132417.18247-2-armbru@redhat.com>
4a2fec
Patchwork-id: 77934
4a2fec
O-Subject: [RHV-7.5 qemu-kvm-rhev PATCH v2 1/1] scsi: Fix onboard HBAs to pick up -drive if=scsi
4a2fec
Bugzilla: 1497740
4a2fec
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
4a2fec
RH-Acked-by: Thomas Huth <thuth@redhat.com>
4a2fec
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
4a2fec
4a2fec
Downstream commit 7977e6031 "scsi: Disable deprecated implicit SCSI
4a2fec
HBA creation more cleanly" regressed -drive if=scsi and its sugared
4a2fec
forms like -cdrom with onboard HBAs.  Instead of creating SCSI devices
4a2fec
connected to the onboard HBA, we reject these options like this:
4a2fec
4a2fec
    $ qemu-kvm -cdrom r7.iso
4a2fec
    qemu-kvm: -cdrom r7.iso: machine type does not support if=scsi,bus=0,unit=2
4a2fec
4a2fec
The culprit is scsi_bus_legacy_handle_cmdline(): commit 7977e6031
4a2fec
accidentally neutered it for the non-deprecated case (onboard SCSI
4a2fec
HBA) in addition to the deprecated case (non-onboard SCSI HBA with
4a2fec
legacy magic).  Fix by narrowing the neutering to the deprecated case.
4a2fec
4a2fec
Signed-off-by: Markus Armbruster <armbru@redhat.com>
4a2fec
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
---
4a2fec
 hw/scsi/scsi-bus.c | 7 ++++---
4a2fec
 1 file changed, 4 insertions(+), 3 deletions(-)
4a2fec
4a2fec
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
4a2fec
index 309daaa..404686a 100644
4a2fec
--- a/hw/scsi/scsi-bus.c
4a2fec
+++ b/hw/scsi/scsi-bus.c
4a2fec
@@ -265,8 +265,6 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk,
4a2fec
 
4a2fec
 void scsi_bus_legacy_handle_cmdline(SCSIBus *bus, bool deprecated)
4a2fec
 {
4a2fec
-#if 0 /* Disabled for Red Hat Enterprise Linux */
4a2fec
-
4a2fec
     Location loc;
4a2fec
     DriveInfo *dinfo;
4a2fec
     int unit;
4a2fec
@@ -279,6 +277,7 @@ void scsi_bus_legacy_handle_cmdline(SCSIBus *bus, bool deprecated)
4a2fec
         }
4a2fec
         qemu_opts_loc_restore(dinfo->opts);
4a2fec
         if (deprecated) {
4a2fec
+#if 0 /* Disabled for Red Hat Enterprise Linux */
4a2fec
             /* Handling -drive not claimed by machine initialization */
4a2fec
             if (blk_get_attached_dev(blk_by_legacy_dinfo(dinfo))) {
4a2fec
                 continue;       /* claimed */
4a2fec
@@ -288,12 +287,14 @@ void scsi_bus_legacy_handle_cmdline(SCSIBus *bus, bool deprecated)
4a2fec
                             " machine type",
4a2fec
                             bus->busnr, unit);
4a2fec
             }
4a2fec
+#else
4a2fec
+            continue;
4a2fec
+#endif
4a2fec
         }
4a2fec
         scsi_bus_legacy_add_drive(bus, blk_by_legacy_dinfo(dinfo),
4a2fec
                                   unit, false, -1, NULL, &error_fatal);
4a2fec
     }
4a2fec
     loc_pop(&loc;;
4a2fec
-#endif
4a2fec
 }
4a2fec
 
4a2fec
 #if 0 /* Disabled for Red Hat Enterprise Linux */
4a2fec
-- 
4a2fec
1.8.3.1
4a2fec