From nobody Thu May 15 20:48:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1503846306166361.6511521007536; Sun, 27 Aug 2017 08:05:06 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8B6607E435; Sun, 27 Aug 2017 15:05:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3BA0F58828; Sun, 27 Aug 2017 15:05:04 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 568A41806108; Sun, 27 Aug 2017 15:05:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v7RF4oLm015492 for ; Sun, 27 Aug 2017 11:04:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9B0076E8F4; Sun, 27 Aug 2017 15:04:50 +0000 (UTC) Received: from colepc.redhat.com (ovpn-116-34.phx2.redhat.com [10.3.116.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0C2886E8F5; Sun, 27 Aug 2017 15:04:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8B6607E435 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Cole Robinson To: libvirt-list@redhat.com Date: Sun, 27 Aug 2017 11:04:42 -0400 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 5/5] qemu: Default to video type=virtio for machvirt X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Sun, 27 Aug 2017 15:05:05 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" arm/aarch64 -M virt on KVM doesn't and will never work with standard VGA card emulation. The recommended method is to use type=3Dvirtio, so let's make it the default for video devices without an explicit type set by the user https://bugzilla.redhat.com/show_bug.cgi?id=3D1404112 Signed-off-by: Cole Robinson Reviewed-by: Pavel Hrdina --- src/qemu/qemu_domain.c | 2 + .../qemuxml2argv-aarch64-video-default.args | 26 ++++++++++++ .../qemuxml2argv-aarch64-video-default.xml | 17 ++++++++ tests/qemuxml2argvtest.c | 6 +++ .../qemuxml2xmlout-aarch64-video-default.xml | 46 ++++++++++++++++++= ++++ tests/qemuxml2xmltest.c | 10 +++++ 6 files changed, 107 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-defau= lt.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-defau= lt.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-video-d= efault.xml diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 7d8c2c1ce..6f9fafb6e 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3670,6 +3670,8 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr de= v, if (dev->data.video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_DEFAULT) { if ARCH_IS_PPC64(def->os.arch) dev->data.video->type =3D VIR_DOMAIN_VIDEO_TYPE_VGA; + else if (qemuDomainIsVirt(def)) + dev->data.video->type =3D VIR_DOMAIN_VIDEO_TYPE_VIRTIO; else dev->data.video->type =3D VIR_DOMAIN_VIDEO_TYPE_CIRRUS; } diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-default.args= b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-default.args new file mode 100644 index 000000000..359c3875d --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-default.args @@ -0,0 +1,26 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-aarch64 \ +-name aarch64-vgpu \ +-S \ +-M virt \ +-cpu cortex-a57 \ +-m 1024 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid f3197c89-6457-44fe-b26d-897090ba6541 \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,\ +path=3D/tmp/lib/domain--1-aarch64-vgpu/monitor.sock,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-no-acpi \ +-boot c \ +-device i82801b11-bridge,id=3Dpci.1,bus=3Dpcie.0,addr=3D0x1 \ +-device pci-bridge,chassis_nr=3D2,id=3Dpci.2,bus=3Dpci.1,addr=3D0x0 \ +-device ioh3420,port=3D0x10,chassis=3D3,id=3Dpci.3,bus=3Dpcie.0,addr=3D0x2= \ +-vnc 127.0.0.1:0 \ +-device virtio-gpu-pci,id=3Dvideo0,bus=3Dpci.2,addr=3D0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-default.xml = b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-default.xml new file mode 100644 index 000000000..bc4ea48f0 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-default.xml @@ -0,0 +1,17 @@ + + aarch64-vgpu + f3197c89-6457-44fe-b26d-897090ba6541 + 1048576 + 1048576 + 1 + + hvm + + + cortex-a57 + + + /usr/bin/qemu-system-aarch64 + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 5cdbc78eb..a536e9397 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2371,6 +2371,12 @@ mymain(void) QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_DEVICE_VIRTIO_GPU, QEMU_CAPS_BOOTINDEX); + DO_TEST("aarch64-video-default", + QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_OBJECT_GPEX, + QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, + QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, + QEMU_CAPS_DEVICE_VIRTIO_GPU, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDG= E, + QEMU_CAPS_VNC); DO_TEST("aarch64-aavmf-virtio-mmio", QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DTB, QEMU_CAPS_DEVICE_VIRTIO_MMIO, diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-video-default.= xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-video-default.xml new file mode 100644 index 000000000..47b46d0d0 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-video-default.xml @@ -0,0 +1,46 @@ + + aarch64-vgpu + f3197c89-6457-44fe-b26d-897090ba6541 + 1048576 + 1048576 + 1 + + hvm + + + + + + + cortex-a57 + + + destroy + restart + destroy + + /usr/bin/qemu-system-aarch64 + + + +
+ + + + +
+ + + + +
+ + + + +