Re: Improve default machine type selection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/15/23 08:40, Ján Tomko wrote:
On a Monday in 2023, Jim Fehlig wrote:
If an explicit machine type is not specified in the VM config, the qemu driver will select the first machine type in the list of machine types for the specified accelerator. See virQEMUCapsGetPreferredMachine

https://gitlab.com/libvirt/libvirt/-/blob/master/src/qemu/qemu_capabilities.c#L6133

On my test machines, this works reasonably well for x86_64 where the first machine type is pc-i440fx-7.1. But for aarch64, the first machine is integratorcp, which is not very useful with maxCpus=1 and other limitations.

Is it possible to run such machine with libvirt?

I just did a quick check with libvirt 9.1.0 (qemu is a bit older, at 7.1.0):

# cat test.xml
<domain type='kvm'>
  <name>test</name>
  <memory unit='KiB'>2097152</memory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type>hvm</type>
<loader readonly='yes' type='pflash'>/usr/share/qemu/aavmf-aarch64-code.bin</loader>
    <nvram template='/usr/share/qemu/aavmf-aarch64-vars.bin'/>
    <boot dev='hd'/>
  </os>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-aarch64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' discard='unmap'/>
      <source file='/var/lib/libvirt/images/test.qcow2'/>
      <target dev='vda' bus='virtio'/>
    </disk>
  </devices>
</domain>
# virsh create test.xml
error: Failed to create domain from test.xml
error: internal error: Unexpected enum value 0 for virDomainDeviceAddressType

I don't _think_ it's a downstream bug, nor fixed in git in the meantime. It appears running the old integratorcp machine with libivrt is not possible.

Regards,
Jim





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux