qemu-patch-raspberry4/hw
John Snow 1602651833 pc/vl: Add units-per-default-bus property
This patch adds the 'units_per_default_bus' property which
allows individual boards to declare their desired
index => (bus,unit) mapping for their default HBA, so that
boards such as Q35 can specify that its default if_ide HBA,
AHCI, only accepts one unit per bus.

This property only overrides the mapping for drives matching
the block_default_type interface.

This patch also adds this property to *all* past and present
Q35 machine types. This retroactive addition is justified
because the previous erroneous index=>(bus,unit) mappings
caused by lack of such a property were not utilized due to
lack of initialization code in the Q35 init routine.

Further, semantically, the Q35 board type has always had the
property that its default HBA, AHCI, only accepts one unit per
bus. The new code added to add devices to drives relies upon
the accuracy of this mapping. Thus, the property is applied
retroactively to reduce complexity of allowing IDE HBAs with
different units per bus.

Examples:

Prior to this patch, all IDE HBAs were assumed to use 2 units
per bus (Master, Slave). When using Q35 and AHCI, however, we
only allow one unit per bus.

-hdb foo.qcow2 would become index=1, or bus=0,unit=1.
-hdd foo.qcow2 would become index=3, or bus=1,unit=1.
-drive file=foo.qcow2,index=5 becomes bus=2,unit=1.

These are invalid for AHCI. They now become, under Q35 only:

-hdb foo.qcow2 --> index=1, bus=1, unit=0.
-hdd foo.qcow2 --> index=3, bus=3, unit=0.
-drive file=foo.qcow2,index=5 --> bus=5,unit=0.

The mapping is adjusted based on the fact that the default IF
for the Q35 machine type is IF_IDE, and units-per-default-bus
overrides the IDE mapping from its default of 2 units per bus
to just 1 unit per bus.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 1412187569-23452-4-git-send-email-jsnow@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-10-03 10:30:33 +01:00
..
9pfs hw/9pfs: Don't return type from host in readdir on local 9p filesystem 2014-09-04 10:51:13 -05:00
acpi pcihp: fix possible array out of bounds 2014-08-25 00:16:06 +02:00
alpha memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
arm - Memory: improve error reporting and avoid crashes on hotplug 2014-09-12 16:55:49 +01:00
audio ac97: register reset via qom 2014-09-29 10:20:05 +02:00
block block: Always compile virtio-blk dataplane 2014-09-22 11:39:51 +01:00
bt l2cap: fix access to freed memory 2014-08-15 19:12:48 +04:00
char serial: check if backed by a physical serial port at realize time 2014-09-19 10:50:07 +02:00
core pci, pc, virtio, misc bugfixes 2014-09-18 20:02:01 +01:00
cpu icc_bus: QOM'ify ICC 2013-12-24 18:02:18 +01:00
cris memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
display vga: Add endian to vmstate 2014-09-30 13:34:09 +02:00
dma hw/dma/i8257: Silence phony error message 2014-09-16 12:35:02 +02:00
gpio pl061: implement input interrupt logic 2014-09-12 14:06:48 +01:00
i2c Fix debug print warning 2014-09-02 22:38:16 +04:00
i386 pc/vl: Add units-per-default-bus property 2014-10-03 10:30:33 +01:00
ide ahci: properly shadow the TFD register 2014-09-22 11:39:41 +01:00
input hw/input/tsc210x.c: Delete unused array tsc2101_rates 2014-09-29 18:48:48 +01:00
intc hw/intc/imx_avic.c: Remove unused function imx_avic_set_prio() 2014-09-29 18:48:47 +01:00
ipack memory: remove memory_region_destroy 2014-08-18 12:06:21 +02:00
isa Fix debug print warning 2014-09-02 22:38:16 +04:00
lm32 memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
m68k memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
mem pc-dimm: Don't check dimm->node when there is non-NUMA config 2014-09-29 19:44:04 +03:00
microblaze memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
mips memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
misc vfio: make rom read endian sensitive 2014-09-22 15:27:43 -06:00
moxie memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
net virtio: Import virtio_vring.h 2014-09-22 11:39:49 +01:00
nvram PPC: mac_nvram: Split NVRAM into OF and OSX parts 2014-09-08 12:50:52 +02:00
openrisc memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
pci pci-hotplug-old: avoid losing error message 2014-09-29 19:44:04 +03:00
pci-bridge ioh3420: remove unused ioh3420_init() declaration 2014-09-02 17:28:26 +03:00
pci-host - Memory: improve error reporting and avoid crashes on hotplug 2014-09-12 16:55:49 +01:00
pcmcia hw: Fix qemu_allocate_irqs() leaks 2014-06-30 21:13:30 +02:00
ppc Fix typos and misspellings in comments 2014-09-20 17:55:53 +04:00
s390x This update brings dataplane to virtio-scsi (NOT 2014-09-30 16:45:35 +01:00
scsi virtio-scsi: Handle TMF request cancellation asynchronously 2014-09-30 13:30:51 +02:00
sd sd: sdhci: Fix ADMA dma_memory_read access 2014-08-04 14:41:54 +01:00
sh4 memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
sparc tcx: Implement hardware acceleration 2014-09-23 22:23:14 +01:00
sparc64 memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
ssi ssi: xilinx_spi: Initialise CS GPIOs as NULL 2014-08-15 18:54:40 +04:00
timer mc146818rtc: add missed field to vmstate 2014-09-11 12:20:32 +02:00
tpm Add ACPI tables for TPM 2014-08-25 00:16:06 +02:00
tricore memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
unicore32 memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
usb ohci: drop computed flags from trace events 2014-09-26 09:43:06 +01:00
virtio This update brings dataplane to virtio-scsi (NOT 2014-09-30 16:45:35 +01:00
watchdog memory: remove memory_region_destroy 2014-08-18 12:06:21 +02:00
xen memory: remove memory_region_destroy 2014-08-18 12:06:21 +02:00
xenpv machine: Conversion of QEMUMachineInitArgs to MachineState 2014-05-28 17:35:01 +02:00
xtensa memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
Makefile.objs pc: implement pc-dimm device abstraction 2014-06-19 16:41:47 +03:00