These are intertwined a bit, hence they are all posted in the same series.
This started out with the intent to generate an error/failure on
request for an IDE controller on a machinetype that doesn't support
IDE (currently anything except 440fx-based machinetypes), or a 2nd IDE
controller on a machinetype that only supports one (i.e. 440fx). This
led to a few other related fixes, and some "fixes related to the
related fixes":
* 1 and 2 just eliminate redundant code that I found while
making the changes.
* 3 & 4 change two sets of if else if else if, into switches,
so that it's cleaner and simpler to add more cases.
* 5 is a utility function that will be used later to make it easier to
get the alias of the controller required by a particular device.
* 6 adds exceptions for the primary IDE on 440fx and primary SATA on
q35 to the function that creates controller alias names (since those
are hardcoded in qemu)
* 7-9 switch all remaining uses of BufferAsprintf(buf,
"blahcontroller%d") with calls to the function that returns the
*real* alias of the controller device.
* 10 removes a test that verifies we allow an IDE controller in an
s390 machine definition, and renames the tests to indicate that
although we're checking to make sure we allow usb controllers on
s390, that this isn't actually a valid config. (I would add a
warning in the appropriate place when this happens, but at the
moment I'm sick of looking at the problem :-/) - This is v2 of the
following patch that I posted by itself earlier:
https://www.redhat.com/archives/libvir-list/2015-April/msg01596.html
https://www.redhat.com/archives/libvir-list/2015-May/msg00031.html
* 11 makes it an error to define an IDE controller that qemu won't be
able to actually create.
* 12 and 13 fix two additional prolems I noticed with the creation of
device and drive strings for SCSI disks - the first is that we add a
"channel=" option even when qemu has told us it doesn't support it,
and the 2nd is that we have carried forward a restriction that bus
must == 0 for SCSI - this check was added in 2009, and it seems that
it is only valid when *not* using -device to define the disk
parameters.
Laine Stump (13):
qemu: use qemuDomainMachineIsI440FX() in appropriate place
qemu: eliminate duplicated code in qemuBuildDriveDevStr()
qemu: change if to switch in qemuBuildDeviceAddressStr
qemu: restructure qemuAssignDeviceControllerAlias
conf: utility to return alias of a controller based on type/index
qemu: add exceptions for alias names of primary sata/ide controllers
qemu: use controller alias when constructing disk/controller args
qemu: use alias for all controller ids in qemuBuildControllerDevStr
qemu: use controller object alias in commandline for virtio-serial
device
qemu: remove test for allowing ide controller in s390, rename usb
tests
qemu: log error when domain has an upsupported IDE controller
qemu: only add channel arg to scsi-disk if qemu binary supports it
qemu: allow bus != 0 for scsi-disk when -device is used
src/conf/domain_conf.c | 34 +++
src/conf/domain_conf.h | 3 +
src/libvirt_private.syms | 1 +
src/qemu/qemu_command.c | 314 ++++++++++++---------
src/qemu/qemu_command.h | 3 +-
src/qemu/qemu_hotplug.c | 4 +-
.../qemuxml2argv-disk-blockio.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-disk-blockio.xml | 1 -
.../qemuxml2argv-disk-drive-network-iscsi-lun.args | 2 +-
.../qemuxml2argv-disk-ide-drive-split.args | 2 +-
.../qemuxml2argv-disk-ide-drive-split.xml | 1 -
.../qemuxml2argv-disk-sata-device.args | 4 +-
.../qemuxml2argv-disk-scsi-disk-split.args | 8 +-
.../qemuxml2argv-disk-scsi-disk-vpd.args | 2 +-
.../qemuxml2argv-disk-scsi-disk-wwn.args | 4 +-
.../qemuxml2argv-disk-scsi-lun-passthrough.args | 12 +-
.../qemuxml2argv-disk-scsi-lun-passthrough.xml | 4 +-
.../qemuxml2argv-disk-scsi-megasas.args | 2 +-
.../qemuxml2argv-disk-scsi-virtio-scsi.args | 2 +-
.../qemuxml2argv-disk-scsi-vscsi.args | 2 +-
.../qemuxml2argv-disk-source-pool-mode.args | 2 +-
.../qemuxml2argv-disk-source-pool-mode.xml | 1 -
.../qemuxml2argv-disk-source-pool.args | 2 +-
.../qemuxml2argv-disk-source-pool.xml | 1 -
.../qemuxml2argv-disk-virtio-scsi-ccw.args | 2 +-
.../qemuxml2argv-disk-virtio-scsi-cmd_per_lun.args | 2 +-
.../qemuxml2argv-disk-virtio-scsi-max_sectors.args | 2 +-
.../qemuxml2argv-disk-virtio-scsi-num_queues.args | 2 +-
.../qemuxml2argv-pseries-vio-user-assigned.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-pseries-vio.args | 2 +-
...uxml2argv-s390-allow-bogus-usb-controller.args} | 0
...muxml2argv-s390-allow-bogus-usb-controller.xml} | 3 -
...=> qemuxml2argv-s390-allow-bogus-usb-none.args} | 0
... => qemuxml2argv-s390-allow-bogus-usb-none.xml} | 0
tests/qemuxml2argvtest.c | 29 +-
.../qemuxml2xmlout-disk-source-pool.xml | 1 -
36 files changed, 266 insertions(+), 192 deletions(-)
rename tests/qemuxml2argvdata/{qemuxml2argv-s390-piix-controllers.args =>
qemuxml2argv-s390-allow-bogus-usb-controller.args} (100%)
rename tests/qemuxml2argvdata/{qemuxml2argv-s390-piix-controllers.xml =>
qemuxml2argv-s390-allow-bogus-usb-controller.xml} (86%)
rename tests/qemuxml2argvdata/{qemuxml2argv-s390-usb-none.args =>
qemuxml2argv-s390-allow-bogus-usb-none.args} (100%)
rename tests/qemuxml2argvdata/{qemuxml2argv-s390-usb-none.xml =>
qemuxml2argv-s390-allow-bogus-usb-none.xml} (100%)
--
2.1.0