1.目的:修改虚拟机xml文件,pc换为q35类型
2.过程:
(1)
修改machine=q35 <type arch='x86_64' machine='q35'>hvm</type>
报如下错:
error: XML error: The PCI controller with index='0' must be model='pcie-root' for this machine type, but model='pci-root' was found instead
(2)
把pci的controller修改为 pcie-root
<controller type='pci' index='0' model='pci-root'/> 改为 <controller type='pci' index='0' model='pcie-root'/>
报如下错:
error:unsupported configuration: IDE controllers are unsupported for this QEMU binary or machine type解决
(3)
如果有cdrom只读光盘,修改xml
<disk type="file" device="cdrom">
<driver name="qemu" type="raw" cache="none"></driver>
<source file="/opt/instance/_base/3d2aaafbbcc373eda7cecdb93d8f6aec.iso"></source>
<target dev="hdb" bus="sata"></target>// 修改bus,bus不能为ide
<readonly></readonly>
<address type="drive" bus="0" controller="0" target="0" unit="1"></address>
</disk>
删除
<controller type="ide" index="0">
<alias name="ide0"></alias>
</controller>
保存xml文件即可,如问题不能解决,请根据实际情况判断,哈哈哈哈