From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 11/11] hw/i386: Deprecate -drive if=scsi with PC machine types
Date: Tue, 21 Feb 2017 13:34:39 +0100 [thread overview]
Message-ID: <1487680479-15132-12-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1487680479-15132-1-git-send-email-armbru@redhat.com>
The PC machines (pc-q35-* pc-i440fx-* pc-* isapc xenfv) automatically
create lsi53c895a SCSI HBAs and SCSI devices to honor -drive if=scsi.
For giggles, try -drive if=scsi,bus=25,media=cdrom --- this makes QEMU
create 25 of them.
lsi53c895a is thoroughly obsolete (PCI Ultra2 SCSI, ca. 2000), and
currently has no maintainer in QEMU. megasas is a better choice,
except with old OSes that lack drivers. virtio-scsi is a much better
choice when you have a driver, but only (newish) Linux comes with one
in the box. There is no good default that works for all guests.
Encourage users to pick a non-obsolete SCSI HBA that works for them by
deprecating -drive if=scsi.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1487161136-9018-4-git-send-email-armbru@redhat.com>
Acked-By: Paolo Bonzini <pbonzini@redhat.com>
---
hw/i386/pc.c | 8 +++++++-
qemu-options.hx | 5 -----
tests/qemu-iotests/051.pc.out | 12 ++++++++----
3 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index c2c75e2..60b0946 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1650,9 +1650,15 @@ void pc_pci_device_init(PCIBus *pci_bus)
int max_bus;
int bus;
+ /* Note: if=scsi is deprecated with PC machine types */
max_bus = drive_get_max_bus(IF_SCSI);
for (bus = 0; bus <= max_bus; bus++) {
- lsi53c895a_create(pci_bus);
+ pci_create_simple(pci_bus, -1, "lsi53c895a");
+ /*
+ * By not creating frontends here, we make
+ * scsi_legacy_handle_cmdline() create them, and warn that
+ * this usage is deprecated.
+ */
}
}
diff --git a/qemu-options.hx b/qemu-options.hx
index 809b2b0..1e815ef 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -654,11 +654,6 @@ If you don't specify the "file=" argument, you define an empty drive:
qemu-system-i386 -drive if=ide,index=1,media=cdrom
@end example
-You can connect a SCSI disk with unit ID 6 on the bus #0:
-@example
-qemu-system-i386 -drive file=file,if=scsi,bus=0,unit=6
-@end example
-
Instead of @option{-fda}, @option{-fdb}, you can use:
@example
qemu-system-i386 -drive file=file,index=0,if=floppy
diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out
index 603bb76..f8047a2 100644
--- a/tests/qemu-iotests/051.pc.out
+++ b/tests/qemu-iotests/051.pc.out
@@ -118,7 +118,8 @@ QEMU X.Y.Z monitor - type 'help' for more information
Testing: -drive if=scsi,media=cdrom
QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+(qemu) QEMU_PROG: -drive if=scsi,media=cdrom: warning: bus=0,unit=0 is deprecated with this machine type
+q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive if=ide
QEMU X.Y.Z monitor - type 'help' for more information
@@ -127,7 +128,8 @@ QEMU_PROG: Initialization of device ide-hd failed: Device initialization failed.
Testing: -drive if=scsi
QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: Initialization of device lsi53c895a failed: Device needs media, but drive is empty
+(qemu) QEMU_PROG: -drive if=scsi: warning: bus=0,unit=0 is deprecated with this machine type
+QEMU_PROG: -drive if=scsi: Device needs media, but drive is empty
Testing: -drive if=virtio
QEMU X.Y.Z monitor - type 'help' for more information
@@ -172,7 +174,8 @@ QEMU X.Y.Z monitor - type 'help' for more information
Testing: -drive file=TEST_DIR/t.qcow2,if=scsi,media=cdrom,readonly=on
QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+(qemu) QEMU_PROG: -drive file=TEST_DIR/t.qcow2,if=scsi,media=cdrom,readonly=on: warning: bus=0,unit=0 is deprecated with this machine type
+q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive file=TEST_DIR/t.qcow2,if=ide,readonly=on
QEMU X.Y.Z monitor - type 'help' for more information
@@ -181,7 +184,8 @@ QEMU_PROG: Initialization of device ide-hd failed: Device initialization failed.
Testing: -drive file=TEST_DIR/t.qcow2,if=scsi,readonly=on
QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+(qemu) QEMU_PROG: -drive file=TEST_DIR/t.qcow2,if=scsi,readonly=on: warning: bus=0,unit=0 is deprecated with this machine type
+q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive file=TEST_DIR/t.qcow2,if=virtio,readonly=on
QEMU X.Y.Z monitor - type 'help' for more information
--
2.7.4
next prev parent reply other threads:[~2017-02-21 12:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-21 12:34 [Qemu-devel] [PULL 00/11] Changes to -drive without if= and with if=scsi Markus Armbruster
2017-02-21 12:34 ` [Qemu-devel] [PULL 01/11] hw: Default -drive to if=ide explicitly where it works Markus Armbruster
2017-02-21 12:34 ` [Qemu-devel] [PULL 02/11] hw/arm/cubieboard hw/arm/xlnx-ep108: Fix units_per_default_bus Markus Armbruster
2017-02-21 12:34 ` [Qemu-devel] [PULL 03/11] hw: Default -drive to if=none instead of ide when ide cannot work Markus Armbruster
2017-02-21 12:34 ` [Qemu-devel] [PULL 04/11] hw: Default -drive to if=none instead of scsi when scsi " Markus Armbruster
2017-02-21 12:34 ` [Qemu-devel] [PULL 05/11] hw/arm/highbank: Default -drive to if=ide instead of if=scsi Markus Armbruster
2017-02-21 12:34 ` [Qemu-devel] [PULL 06/11] blockdev: Improve message for orphaned -drive Markus Armbruster
2017-02-21 12:34 ` [Qemu-devel] [PULL 07/11] blockdev: Make orphaned -drive fatal Markus Armbruster
2017-02-21 12:34 ` [Qemu-devel] [PULL 08/11] hw: Drop superfluous special checks for orphaned -drive Markus Armbruster
2017-02-21 12:34 ` [Qemu-devel] [PULL 09/11] hw/scsi: Concentrate -drive if=scsi auto-create in one place Markus Armbruster
2017-02-21 12:34 ` [Qemu-devel] [PULL 10/11] hw: Deprecate -drive if=scsi with non-onboard HBAs Markus Armbruster
2017-02-21 12:34 ` Markus Armbruster [this message]
2017-02-21 13:37 ` [Qemu-devel] [PULL 00/11] Changes to -drive without if= and with if=scsi no-reply
2017-02-21 15:05 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1487680479-15132-12-git-send-email-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).