提交 9324f67a 编写于 作者: M Michal Privoznik

qemuBuildDriveDevStr: Prefer default aliases for IDE bus

https://bugzilla.redhat.com/show_bug.cgi?id=1434451

When testing user aliases it was discovered that for 440fx
machine type which has default IDE bus builtin, domain cannot
start if IDE controller has the user provided alias. This is
because for 440fx we don't put the IDE controller onto the
command line (since it is builtin) and therefore any device that
is plugged onto the bus must use the default alias.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 010f88d5
......@@ -1886,9 +1886,17 @@ qemuBuildDriveDevStr(const virDomainDef *def,
virBufferAddLit(&opt, "ide-drive");
}
if (!(contAlias = virDomainControllerAliasFind(def, VIR_DOMAIN_CONTROLLER_TYPE_IDE,
disk->info.addr.drive.controller)))
goto error;
/* When domain has builtin IDE controller we don't put it onto cmd
* line. Therefore we can't set its alias. In that case, use the
* default one. */
if (qemuDomainHasBuiltinIDE(def)) {
contAlias = "ide";
} else {
if (!(contAlias = virDomainControllerAliasFind(def,
VIR_DOMAIN_CONTROLLER_TYPE_IDE,
disk->info.addr.drive.controller)))
goto error;
}
virBufferAsprintf(&opt, ",bus=%s.%d,unit=%d",
contAlias,
disk->info.addr.drive.bus,
......
......@@ -44,8 +44,8 @@ id=drive-ua-myEncryptedDisk1 \
id=ua-myEncryptedDisk1 \
-drive file=/home/zippy/tmp/install-amd64-minimal-20140619.iso,format=raw,\
if=none,media=cdrom,id=drive-ua-WhatAnAwesomeCDROM,readonly=on,cache=none \
-device ide-drive,bus=ua-DoesAnybodyStillUseIDE.1,unit=0,\
drive=drive-ua-WhatAnAwesomeCDROM,id=ua-WhatAnAwesomeCDROM \
-device ide-drive,bus=ide.1,unit=0,drive=drive-ua-WhatAnAwesomeCDROM,\
id=ua-WhatAnAwesomeCDROM \
-device virtio-net-pci,vlan=0,id=ua-CheckoutThisNIC,mac=52:54:00:d6:c0:0b,\
bus=pci.0,addr=0x3 \
-net tap,fd=3,vlan=0,name=hostua-CheckoutThisNIC \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册