diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c6962d5d95..b231d65b24 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4599,11 +4599,25 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef, } break; - /* We always get an IDE controller, whether we want it or not. */ case VIR_DOMAIN_CONTROLLER_TYPE_IDE: + /* Since we currently only support the integrated IDE controller + * on 440fx, if we ever get to here, it's because some other + * machinetype had an IDE controller specified, or a 440fx had + * multiple ide controllers. + */ + if (qemuDomainMachineIsI440FX(domainDef)) + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Only a single IDE controller is unsupported " + "for this machine type")); + else + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("IDE controllers are unsupported for " + "this QEMU binary or machine type")); + goto error; + default: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Unknown controller type: %s"), + _("Unsupported controller type: %s"), virDomainControllerTypeToString(def->type)); goto error; } @@ -8629,20 +8643,21 @@ qemuBuildCommandLine(virConnectPtr conn, * List of controller types that we add commandline args for, * *in the order we want to add them*. * - * We don't add an explicit IDE or FD controller because the + * We don't add an explicit FD controller because the * provided PIIX4 device already includes one. It isn't possible to * remove the PIIX4. * * We don't add PCI/PCIe root controller either, because it's * implicit, but we do add PCI bridges and other PCI * controllers, so we leave that in to check each - * one. Likewise, we don't do anything for the primary SATA - * controller on q35, but we do add those beyond this one - * exception. + * one. Likewise, we don't do anything for the primary IDE + * controller on an i440fx machine or primary SATA on q35, but + * we do add those beyond these two exceptions. */ VIR_DOMAIN_CONTROLLER_TYPE_PCI, VIR_DOMAIN_CONTROLLER_TYPE_USB, VIR_DOMAIN_CONTROLLER_TYPE_SCSI, + VIR_DOMAIN_CONTROLLER_TYPE_IDE, VIR_DOMAIN_CONTROLLER_TYPE_SATA, VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL, VIR_DOMAIN_CONTROLLER_TYPE_CCID, @@ -9439,6 +9454,11 @@ qemuBuildCommandLine(virConnectPtr conn, cont->idx == 0 && qemuDomainMachineIsQ35(def)) continue; + /* first IDE controller on i440fx machines is implicit */ + if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_IDE && + cont->idx == 0 && qemuDomainMachineIsI440FX(def)) + continue; + if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_USB && cont->model == -1 && !qemuDomainMachineIsQ35(def) && diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.args index 33f87142f3..79af23d1e3 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.args @@ -6,4 +6,4 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -drive file=/tmp/idedisk.img,if=none,id=drive-ide0-0-2 \ -device ide-hd,bus=ide.0,unit=2,drive=drive-ide0-0-2,id=ide0-0-2,\ logical_block_size=512,physical_block_size=512 \ --device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.xml index 52c9704cd2..2b400c3d61 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.xml @@ -27,7 +27,6 @@ - diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-ide-drive-split.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-ide-drive-split.args index 9ccdd5e2fd..4fe04b3233 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-ide-drive-split.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-ide-drive-split.args @@ -5,4 +5,4 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -device ide-cd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 \ -drive file=/tmp/idedisk.img,if=none,id=drive-ide0-0-2 \ -device ide-hd,bus=ide.0,unit=2,drive=drive-ide0-0-2,id=ide0-0-2 \ --device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-ide-drive-split.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-ide-drive-split.xml index 21c285b803..65c438bcd7 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-ide-drive-split.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-ide-drive-split.xml @@ -26,7 +26,6 @@ - diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.args index 8f6a3dd9f6..75562946b6 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.args @@ -7,4 +7,4 @@ file=iscsi://iscsi.example.com:3260/demo-target/2,if=none,media=cdrom,id=drive-i -device ide-drive,bus=ide.0,unit=2,drive=drive-ide0-0-2,id=ide0-0-2 -drive \ file=/tmp/idedisk.img,if=none,id=drive-ide0-0-3 -device \ ide-drive,bus=ide.0,unit=3,drive=drive-ide0-0-3,id=ide0-0-3 -device \ -virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 +virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.xml index c791717232..dcab1e9aa0 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.xml @@ -41,7 +41,6 @@ - diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.args index 6b409b7a95..f930e467ca 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.args @@ -7,4 +7,4 @@ if=none,media=cdrom,id=drive-ide0-1-0 -device \ ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -drive \ file=/tmp/idedisk.img,if=none,id=drive-ide0-0-2 -device \ ide-drive,bus=ide.0,unit=2,drive=drive-ide0-0-2,id=ide0-0-2 -device \ -virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 +virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml index ef095a0920..19255c98fe 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml @@ -39,7 +39,6 @@ - diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-source-pool.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-source-pool.xml index 31e4928caf..d3c8b692b1 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-source-pool.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-source-pool.xml @@ -37,7 +37,6 @@ -