From nobody Sun Feb 8 14:31:16 2026 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 1503490460071141.424750636736; Wed, 23 Aug 2017 05:14:20 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 93B4E7EAA1; Wed, 23 Aug 2017 12:14:17 +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 35B5060C28; Wed, 23 Aug 2017 12:14:17 +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 470371800C8E; Wed, 23 Aug 2017 12:14:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v7NCEFsJ005894 for ; Wed, 23 Aug 2017 08:14:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9DF978E796; Wed, 23 Aug 2017 12:14:15 +0000 (UTC) Received: from caroline.localdomain (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 70D0E8E79C for ; Wed, 23 Aug 2017 12:14:13 +0000 (UTC) Received: from caroline.brq.redhat.com (caroline.brq.redhat.com [127.0.0.1]) by caroline.localdomain (Postfix) with ESMTP id 50F171206ED for ; Wed, 23 Aug 2017 14:14:12 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 93B4E7EAA1 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Martin Kletzander To: libvir-list@redhat.com Date: Wed, 23 Aug 2017 14:14:10 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] qemu: Add support for virtio-vga/gpu's max_outputs= parameter 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 23 Aug 2017 12:14:18 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Martin Kletzander --- src/qemu/qemu_command.c | 5 +++++ tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args | 2 +- tests/qemuxml2argvtest.c | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 68fc137069a5..636058b01606 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4484,6 +4484,11 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, if (video->heads) virBufferAsprintf(&buf, ",max_outputs=3D%u", video->heads); } + } else if (video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_VIRTIO) { + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS)) { + if (video->heads) + virBufferAsprintf(&buf, ",max_outputs=3D%u", video->heads); + } } else if (video->vram && ((video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_VGA && virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) || diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args b/te= sts/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args index 1aa38bbeec2e..b526ac95956d 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args @@ -22,5 +22,5 @@ server,nowait \ -drive file=3D/var/lib/libvirt/images/QEMUGuest1,format=3Dqcow2,if=3Dnone,\ id=3Ddrive-ide0-0-0,cache=3Dnone \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ --device virtio-vga,id=3Dvideo0,bus=3Dpci.0,addr=3D0x2 \ +-device virtio-vga,id=3Dvideo0,max_outputs=3D1,bus=3Dpci.0,addr=3D0x2 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 5cdbc78eb808..7b0778844f51 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1872,7 +1872,8 @@ mymain(void) DO_TEST("video-virtio-vga", QEMU_CAPS_DEVICE_VIRTIO_GPU, QEMU_CAPS_DEVICE_VIRTIO_VGA, - QEMU_CAPS_DEVICE_VIDEO_PRIMARY); + QEMU_CAPS_DEVICE_VIDEO_PRIMARY, + QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS); DO_TEST_PARSE_ERROR("video-invalid", NONE); =20 DO_TEST("virtio-rng-default", --=20 2.14.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list