Bug 1404112

Summary: set usable video model default for aarch64 qemu (not cirrus)
Product: [Community] Virtualization Tools Reporter: Sam Song <yeahspyme>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: agedosier, berrange, clalancette, crobinso, itamar, laine, libvirt-maint, rbalakri, veillard, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-14 20:35:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
the domain definition none

Description Sam Song 2016-12-13 06:13:28 UTC
Created attachment 1231067 [details]
the domain definition

Description of problem:
When I define a aarch64 domain, the libvirt throws the error below:
$ virsh define arm1.xml
error: Failed to define domain from arm1.xml
error: unsupported configuration: PCI controller at index 1 (0x01) has bus='0x01', but index must be larger than bus


Version-Release number of selected component (if applicable):
$ libvirtd --version
libvirtd (libvirt) 2.2.0

$ uname -a
Linux sam-pc.local 4.8.12-300.fc25.x86_64 #1 SMP Fri Dec 2 17:52:11 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

$ qemu-system-aarch64 --version
QEMU emulator version 2.7.0(qemu-2.7.0-7.fc25), Copyright (c) 2003-2016 Fabrice Bellard and the QEMU Project developers


How reproducible:

Steps to Reproduce:
1.install qemu-system-aarch64, libvirt, edk2-aarch64
2.define a domain using the attached

Actual results:
define failed

Expected results:
define the domain successfully

Additional info:
$ cat arm1.xml
<domain type='qemu'>
  <name>arm1</name>
  <uuid>8028f71a-1db8-40a4-94fa-5a4a42014270</uuid>
  <memory unit='MiB'>2048</memory>
  <currentMemory unit='MiB'>2048</currentMemory>
  <vcpu>2</vcpu>
  <os>
    <type arch='aarch64' machine='virt'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/edk2/aarch64/QEMU_EFI-pflash.raw</loader>
  </os>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>cortex-a57</model>
  </cpu>
  <devices>
    <emulator>/usr/bin/qemu-system-aarch64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/home/sam/xenial-server-cloudimg-arm64-uefi1.img'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <graphics type='vnc' port='5900' autoport='yes' keymap='en-us'/>
  </devices>
</domain>

Comment 1 Cole Robinson 2017-06-24 13:59:08 UTC
That particular error is about libvirt not setting up a correct PCI controller layout, however that's fixed in f26. The remaining 'bug' in this area is that the default added <video> device gets model=cirrus which isn't available for aarch64, so libvirt should default to a different model

That said, your config as is isn't going to work at any point. For x86 VMs you can just add a <graphics> device and automatically and libvirt fills in the <video> config, and qemu gives an implicit mouse/keyboard setup. However on other archs you need to specify the mouse/keyboard manually

On f26, you can define that XML, then open up virt-manager, and add a controller=usb3, input=tablet, input=usb keyboard, and change the video model to virtio and it should work

Comment 2 Cole Robinson 2017-06-28 20:32:45 UTC
patches posted upstream:

https://www.redhat.com/archives/libvir-list/2017-June/msg01269.html

Comment 3 Cole Robinson 2017-09-14 20:35:25 UTC
Upstream now:

commit dda0da14cd6ebff98c2293b1407371286853a38f
Author: Cole Robinson <crobinso>
Date:   Sun Aug 27 11:04:42 2017 -0400

    qemu: Default to video type=virtio for machvirt