Skip to content
This repository has been archived by the owner on Sep 30, 2023. It is now read-only.

[avocado-vt]virsh hypervisor-cpu-compare报错 #456

Open
lvxiaoqian555 opened this issue Nov 16, 2022 · 0 comments
Open

[avocado-vt]virsh hypervisor-cpu-compare报错 #456

lvxiaoqian555 opened this issue Nov 16, 2022 · 0 comments

Comments

@lvxiaoqian555
Copy link
Contributor

使用以下命令获取主机能力

virsh domcapabilities qemu /usr/bin/qemu-system-riscv64 riscv64

保存在 /var/lib/libvirt/images/avocado_9fujin2w/cpu.xml

<domainCapabilities>
  <path>/usr/bin/qemu-system-riscv64</path>
  <domain>qemu</domain>
  <machine>spike</machine>
  <arch>riscv64</arch>
  <vcpu max='8'/>
  <iothreads supported='yes'/>
  <os supported='yes'>
    <enum name='firmware'/>
    <loader supported='yes'>
      <value>/usr/share/OVMF/OVMF_CODE.fd</value>
      <value>/usr/share/OVMF/OVMF_CODE.secboot.fd</value>
      <value>/usr/share/OVMF/OVMF_CODE.ms.fd</value>
      <enum name='type'>
        <value>rom</value>
        <value>pflash</value>
      </enum>
      <enum name='readonly'>
        <value>yes</value>
        <value>no</value>
      </enum>
      <enum name='secure'>
        <value>no</value>
      </enum>
    </loader>
  </os>
  <cpu>
    <mode name='host-passthrough' supported='no'/>
    <mode name='maximum' supported='no'/>
    <mode name='host-model' supported='no'/>
    <mode name='custom' supported='no'/>
  </cpu>
  <memoryBacking supported='yes'>
    <enum name='sourceType'>
      <value>file</value>
      <value>anonymous</value>
      <value>memfd</value>
    </enum>
  </memoryBacking>
  <devices>
    <disk supported='yes'>
      <enum name='diskDevice'>
        <value>disk</value>
        <value>cdrom</value>
        <value>floppy</value>
        <value>lun</value>
      </enum>
      <enum name='bus'>
        <value>fdc</value>
        <value>scsi</value>
        <value>virtio</value>
        <value>usb</value>
        <value>sata</value>
      </enum>
      <enum name='model'>
        <value>virtio</value>
        <value>virtio-transitional</value>
        <value>virtio-non-transitional</value>
      </enum>
    </disk>
    <graphics supported='yes'>
      <enum name='type'>
        <value>sdl</value>
        <value>vnc</value>
        <value>spice</value>
        <value>egl-headless</value>
      </enum>
    </graphics>
    <video supported='yes'>
      <enum name='modelType'>
        <value>vga</value>
        <value>cirrus</value>
        <value>vmvga</value>
        <value>qxl</value>
        <value>virtio</value>
        <value>none</value>
        <value>bochs</value>
        <value>ramfb</value>
      </enum>
    </video>
    <hostdev supported='yes'>
      <enum name='mode'>
        <value>subsystem</value>
      </enum>
      <enum name='startupPolicy'>
        <value>default</value>
        <value>mandatory</value>
        <value>requisite</value>
        <value>optional</value>
      </enum>
      <enum name='subsysType'>
        <value>usb</value>
        <value>pci</value>
        <value>scsi</value>
      </enum>
      <enum name='capsType'/>
      <enum name='pciBackend'/>
    </hostdev>
    <rng supported='yes'>
      <enum name='model'>
        <value>virtio</value>
        <value>virtio-transitional</value>
        <value>virtio-non-transitional</value>
      </enum>
      <enum name='backendModel'>
        <value>random</value>
        <value>egd</value>
        <value>builtin</value>
      </enum>
    </rng>
    <filesystem supported='yes'>
      <enum name='driverType'>
        <value>path</value>
        <value>handle</value>
        <value>virtiofs</value>
      </enum>
    </filesystem>
    <tpm supported='no'/>
  </devices>
  <features>
    <gic supported='no'/>
    <vmcoreinfo supported='yes'/>
    <genid supported='no'/>
    <backingStoreInput supported='yes'/>
    <backup supported='yes'/>
    <sev supported='no'/>
  </features>
</domainCapabilities>

然后使用命令比较主机上hypervisor创建的CPU

virsh hypervisor-cpu-compare /var/lib/libvirt/images/avocado_9fujin2w/cpu.xml --virttype qemu --error

会出现如下报错

error: File '/var/lib/libvirt/images/avocado_9fujin2w/cpu.xml' does not contain any <cpu> element or valid domain XML, host capabilities XML, or domain capabilities XML

cpu.xml中是有 <cpu> 相关的元素的,请问有哪位老师知道这是个bug还是我哪里配置不对吗?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant