diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 4628dac73e3f3cc6e963ba4643273476b57976dc..e6239c993cd6c084a5ff13f9815f8635a33e8e98 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4383,18 +4383,15 @@ qemuBuildDriveDevStr(virDomainDefPtr def, if (qemuDomainMachineIsQ35(def) && disk->info.addr.drive.controller == 0) { /* Q35 machines have an implicit ahci (sata) controller at - * 00:1F.2 which has no "id" associated with it. For this - * reason, we can't refer to it as "ahci0". Instead, we - * don't give an id, which qemu interprets as "use the - * first ahci controller". We then need to specify the - * unit with "unit=%d" rather than adding it onto the bus - * arg. + * 00:1F.2 which for some reason is hardcoded with the id + * "ide" instead of the seemingly more reasonable "ahci0" + * or "sata0". */ - virBufferAsprintf(&opt, ",unit=%d", disk->info.addr.drive.unit); + virBufferAsprintf(&opt, ",bus=ide.%d", disk->info.addr.drive.unit); } else { /* All other ahci controllers have been created by - * libvirt, so they *do* have an id, and we can identify - * them that way. + * libvirt, and we gave them the id "ahci${n}" where ${n} + * is the controller number. So we identify them that way. */ virBufferAsprintf(&opt, ",bus=ahci%d.%d", disk->info.addr.drive.controller, diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args index e10ccb197570f967c233ded7fa085e9fc2a4ad9b..175c0dcf00c6d585cc13b8ef6aa70ab23e586f3c 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args @@ -5,5 +5,5 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x2 \ -device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x1 \ -drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-sata0-0-0 \ --device ide-drive,unit=0,drive=drive-sata0-0-0,id=sata0-0-0 \ +-device ide-drive,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0 \ -vga qxl -global qxl.ram_size=67108864 -global qxl.vram_size=18874368 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-q35.args index 4461eba1b84624b0aea599e82c82365d1dee2fd0..6bd5f4c0c2aca70e6ba0f1e27e7d85028fda6331 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-q35.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35.args @@ -4,5 +4,5 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x2 \ -device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x1 \ -drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-sata0-0-0 \ --device ide-drive,unit=0,drive=drive-sata0-0-0,id=sata0-0-0 \ +-device ide-drive,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0 \ -vga qxl -global qxl.ram_size=67108864 -global qxl.vram_size=18874368