From nobody Mon Apr 29 04:41:06 2024 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.zoho.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 1497526965671908.4267716153114; Thu, 15 Jun 2017 04:42:45 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 64BA080F7B; Thu, 15 Jun 2017 11:42:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9D96C8ED4C; Thu, 15 Jun 2017 11:42:42 +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 46BA54BB7F; Thu, 15 Jun 2017 11:42:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5FBgcgH017306 for ; Thu, 15 Jun 2017 07:42:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 18BEF78436; Thu, 15 Jun 2017 11:42:38 +0000 (UTC) Received: from caroline.brq.redhat.com (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 93DD47E494 for ; Thu, 15 Jun 2017 11:42:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 64BA080F7B 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=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 64BA080F7B From: Martin Kletzander To: libvir-list@redhat.com Date: Thu, 15 Jun 2017 13:42:33 +0200 Message-Id: <41ebdcee9101e01c176cf346159226ddc12c5dc0.1497526664.git.mkletzan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2] qemu: Pass the number of heads even with -vga qxl 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 15 Jun 2017 11:42:44 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When added in multiple previous commits, it was used only with -device qxl(-vga), but for some QEMUs (< 1.6) we need to add this functionality when using -vga qxl as well. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1283207 Signed-off-by: Martin Kletzander --- v2: - Do not change the domain definition - Adjust the code so that it looks the same as other chunks before above v1: - https://www.redhat.com/archives/libvir-list/2017-June/msg00606.html src/qemu/qemu_command.c | 7 ++++ .../qemuxml2argv-video-vga-qxl-heads.args | 30 ++++++++++++++ .../qemuxml2argv-video-vga-qxl-heads.xml | 47 ++++++++++++++++++= ++++ tests/qemuxml2argvtest.c | 3 ++ 4 files changed, 87 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads= .args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads= .xml diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 8c12b2be086a..88ce3787d968 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4590,6 +4590,7 @@ qemuBuildVgaVideoCommand(virCommandPtr cmd, unsigned int vram =3D video->vram; unsigned int vram64 =3D video->vram64; unsigned int vgamem =3D video->vgamem; + unsigned int heads =3D video->heads; if (ram) { virCommandAddArg(cmd, "-global"); @@ -4613,6 +4614,12 @@ qemuBuildVgaVideoCommand(virCommandPtr cmd, virCommandAddArgFormat(cmd, "%s.vgamem_mb=3D%u", dev, vgamem / 1024); } + if (heads && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_MAX_OUTPUTS)) { + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.max_outputs=3D%u", + dev, heads); + } } if (video->vram && diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.args b= /tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.args new file mode 100644 index 000000000000..411a2eedbc4b --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.args @@ -0,0 +1,30 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name QEMUGuest1 \ +-S \ +-M pc \ +-m 214 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ +-no-acpi \ +-boot c \ +-usb \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ +-device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ +-vga qxl \ +-global qxl-vga.ram_size=3D67108864 \ +-global qxl-vga.vram_size=3D67108864 \ +-global qxl-vga.max_outputs=3D1 \ +-device qxl,id=3Dvideo1,ram_size=3D67108864,vram_size=3D33554432,max_outpu= ts=3D3,\ +bus=3Dpci.0,addr=3D0x4 \ +-device qxl,id=3Dvideo2,ram_size=3D67108864,vram_size=3D67108864,max_outpu= ts=3D7,\ +bus=3Dpci.0,addr=3D0x5 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.xml b/= tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.xml new file mode 100644 index 000000000000..d878ddcd6d2e --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.xml @@ -0,0 +1,47 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + +
+ + +
+ + +
+ + + + +