From patchwork Wed Jun 28 18:49:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 106567 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp251394qge; Wed, 28 Jun 2017 11:55:35 -0700 (PDT) X-Received: by 10.55.207.5 with SMTP id e5mr13896493qkj.34.1498676135042; Wed, 28 Jun 2017 11:55:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498676135; cv=none; d=google.com; s=arc-20160816; b=zt6k5hkv5yVFBrpILxG3YR/t+5bHFpIWuQLdAiTbpPSGZTNiF8Tr34lF+2GYMiNDLI LxLj4YbK4UEVl4sHaT55s4dEhbHm11rCNfbDU6S9+Ay8GYGHyjvshR34hapZ0AP3qRmD 6tCGxeQLSCMk6Pr9iATE5VriWrR6leEOxsd7ARocs7Hc3Itsp+X/MGzEsnxleGuZGpx/ IfrhNHEGxBJdU3vCqdFUgjRha6UIMgl22KFEnfxPnfPMtERck8HPrLZnmKxxlVKsX8KP C0dcl1bXxhAZYQ+8UvB00O0bb0bOqv38hpmRVkpe3u1GFVZe55HigdPuhLRY/cCZbrGo Sixw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:references :in-reply-to:message-id:date:to:from:delivered-to:dkim-filter :dmarc-filter:arc-authentication-results; bh=NC6N10B3m4mDdYTorMt7xZoxGZ//a07RZRatqmANxpM=; b=O13KacVUokotf9eS0oWbLLZeyHG8GpCd4ipeq+ukPOkGb3cunaxytyaqdTfIvroAQZ Q/azQOrFvCpZEg+pQ9TOpdkhsxsE04DTcWM84LzdF1D7npJaiQAkxIoSxTlNszpYm8vN XqPQrjGULvrDteC8PvY0cirDE/0C6hFv3NJJdOek7xwgelrqvFQ2jjsOkA3Q8JZRrPwf MJMEcvZ6R+3wKBqwbbAamkcAAmjE53kZZOv9ITUNFqZhFNWfcK8XEcQ0a2BG3/lEc0Wi qi+Iio2KuMZL8sxl5uOP/l7OUTdWYaeQKmiiCCJkL9PyaABTz5ktLynWWXjdLcluYr7r 1ZZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id c48si2770413qtb.271.2017.06.28.11.55.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Jun 2017 11:55:35 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8DD044ACCB; Wed, 28 Jun 2017 18:55:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8DD044ACCB Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8DD044ACCB 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 354CF5D6A6; Wed, 28 Jun 2017 18:55:33 +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 C8BD71853E32; Wed, 28 Jun 2017 18:55:32 +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 v5SInkkx031285 for ; Wed, 28 Jun 2017 14:49:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1AFC962930; Wed, 28 Jun 2017 18:49:46 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from worklaptop.redhat.com (ovpn-116-174.phx2.redhat.com [10.3.116.174]) by smtp.corp.redhat.com (Postfix) with ESMTP id 87DE45D6A6; Wed, 28 Jun 2017 18:49:45 +0000 (UTC) From: Cole Robinson To: libvir-list@redhat.com Date: Wed, 28 Jun 2017 14:49:34 -0400 Message-Id: <0deaf1e94b35ac550c62ae7a15a43cf34a0bb0cc.1498675591.git.crobinso@redhat.com> 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 8/8] 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 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 28 Jun 2017 18:55:34 +0000 (UTC) arm/aarch64 -M virt on KVM doesn't and will never work with standard VGA card emulation. The recommended method is to use type=virtio, 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=1404112 Signed-off-by: Cole Robinson --- src/qemu/qemu_domain.c | 2 + .../qemuxml2argv-aarch64-video-default.args | 24 +++++++++++ .../qemuxml2argv-aarch64-video-default.xml | 17 ++++++++ tests/qemuxml2argvtest.c | 6 +++ .../qemuxml2xmlout-aarch64-video-default.xml | 46 ++++++++++++++++++++++ tests/qemuxml2xmltest.c | 6 +++ 6 files changed, 101 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-default.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-default.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-video-default.xml -- 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: John Ferlan diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index b41b3c5cc..69bf1cb94 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3584,6 +3584,8 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, if (dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_DEFAULT) { if ARCH_IS_PPC64(def->os.arch) dev->data.video->type = VIR_DOMAIN_VIDEO_TYPE_VGA; + else if (qemuDomainIsVirt(def)) + dev->data.video->type = VIR_DOMAIN_VIDEO_TYPE_VIRTIO; else dev->data.video->type = 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..8e56c4250 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-default.args @@ -0,0 +1,24 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-aarch64 \ +-name aarch64-vgpu \ +-S \ +-M virt \ +-cpu cortex-a57 \ +-m 1024 \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid f3197c89-6457-44fe-b26d-897090ba6541 \ +-nodefconfig \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-aarch64-vgpu/monitor.sock,server,nowait \ +-no-acpi \ +-boot c \ +-device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1 \ +-device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \ +-device ioh3420,port=0x10,chassis=3,id=pci.3,bus=pcie.0,addr=0x2 \ +-vnc 127.0.0.1:0 \ +-device virtio-gpu-pci,id=video0,bus=pci.2,addr=0x1 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 27eea70ae..ed7b004cf 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2243,6 +2243,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_BRIDGE, + 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 + + + +
+ + + + +
+ + + + +
+ + + + +