Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

A.19.10.3.2. 不正确的驱动器设备类型

症状
CD-ROM 虚拟驱动器的源镜像定义不存在,尽管添加了:
# virsh dumpxml domain
<domain type='kvm'>
  ...
  <disk type='block' device='cdrom'>
    <driver name='qemu' type='raw'/>
    <target dev='hdc' bus='ide'/>
    <readonly/>
  </disk>
  ...
</domain>
解决方案
通过添加缺少的 <source> 参数更正 XML:
<disk type='block' device='cdrom'>
  <driver name='qemu' type='raw'/>
  <source file='/path/to/image.iso'/>
  <target dev='hdc' bus='ide'/>
  <readonly/>
</disk>
type='block' 磁盘设备预期源是一个物理设备。要将磁盘与镜像文件搭配使用,使用 type='file' 替代。