From nobody Mon Dec 15 03:05:51 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 1507290345179251.9367173215153; Fri, 6 Oct 2017 04:45:45 -0700 (PDT) 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 D47A31E2E4; Fri, 6 Oct 2017 11:45: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 A47F967581; Fri, 6 Oct 2017 11:45: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 C0034410B2; Fri, 6 Oct 2017 11:45:41 +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 v96BIABi027381 for ; Fri, 6 Oct 2017 07:18:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1ED8667583; Fri, 6 Oct 2017 11:18:10 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9AF176701A for ; Fri, 6 Oct 2017 11:18:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D47A31E2E4 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Pavel Hrdina To: libvir-list@redhat.com Date: Fri, 6 Oct 2017 13:18:01 +0200 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 2/2] qemu: format vgamem_mb on QEMU command line for cirrus video 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 06 Oct 2017 11:45:44 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1447831 Signed-off-by: Pavel Hrdina --- src/qemu/qemu_command.c | 3 +++ .../qemuxml2argv-video-cirrus-vgamem.args | 22 ++++++++++++++++++= ++++ .../qemuxml2argv-video-cirrus-vgamem.xml | 22 ++++++++++++++++++= ++++ tests/qemuxml2argvtest.c | 4 ++++ 4 files changed, 51 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-cirrus-vgamem= .args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-cirrus-vgamem= .xml diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 9c8bde49a8..96381e8751 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4610,6 +4610,9 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, virQEMUCapsGet(qemuCaps, QEMU_CAPS_VMWARE_SVGA_VGAMEM)))) { =20 virBufferAsprintf(&buf, ",vgamem_mb=3D%u", video->vram / 1024); + } else if (video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_CIRRUS) { + if (video->vram && virQEMUCapsGet(qemuCaps, QEMU_CAPS_CIRRUS_VGAME= M)) + virBufferAsprintf(&buf, ",vgamem_mb=3D%u", video->vram / 1024); } =20 if (qemuBuildDeviceAddressStr(&buf, def, &video->info, qemuCaps) < 0) diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-cirrus-vgamem.args b= /tests/qemuxml2argvdata/qemuxml2argv-video-cirrus-vgamem.args new file mode 100644 index 0000000000..883165b7c1 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-cirrus-vgamem.args @@ -0,0 +1,22 @@ +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 1024 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-nographic \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-no-acpi \ +-boot c \ +-usb \ +-device cirrus-vga,id=3Dvideo0,vgamem_mb=3D16,bus=3Dpci.0,addr=3D0x2 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-cirrus-vgamem.xml b/= tests/qemuxml2argvdata/qemuxml2argv-video-cirrus-vgamem.xml new file mode 100644 index 0000000000..9f6f97d3eb --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-cirrus-vgamem.xml @@ -0,0 +1,22 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 1048576 + 1048576 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index a505864b87..19f662ece9 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1861,6 +1861,10 @@ mymain(void) QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_DEVICE_QXL); + DO_TEST("video-cirrus-vgamem", + QEMU_CAPS_DEVICE_CIRRUS_VGA, + QEMU_CAPS_CIRRUS_VGAMEM, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST("video-vga-nodevice", QEMU_CAPS_DEVICE_VGA); DO_TEST("video-vga-device", QEMU_CAPS_DEVICE_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list