From nobody Tue Apr 30 19:39:07 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.zohomail.com;
dkim=fail;
spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as
permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com;
dmarc=fail(p=none dis=none) header.from=gmail.com
ARC-Seal: i=1; a=rsa-sha256; t=1571287066; cv=none;
d=zoho.com; s=zohoarc;
b=iqRFWYcT2TtoNa7MoIPWnIQs9zebD4ZOfCUMjepy2RW2nodtnDiDRa/FO2KkEIHA31FpCEjxXoyphyhZGJwNHvNnFPANioMXeid0CElr+ZkLyTizvcSfYOocxjoS98qL2K6+1204CfqTxuW1wgeWAWcpTn0dh9RPcManytF9+WQ=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com;
s=zohoarc;
t=1571287066;
h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To;
bh=BNn9NfqJ9ZXJ1LelMRDeBFSY/6kk4S1Llcu8utiD/Rc=;
b=C6mbAvWFILkOmZjoRiNZQKuAOjiCx4Y6U1WsRMOvChDlva0ywAUu+zWEO9SEh0nIPN8VrCO/4u8IaeJw4TQF1CijDFT1wekKJ6OaW1FL97CvrOQmqYViQqSkxz+E+1WnVGVBeq4c/fPJ/TylfC764puD9xFhX5aXWpUADjwIhtQ=
ARC-Authentication-Results: i=1; mx.zoho.com;
dkim=fail;
spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as
permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com;
dmarc=fail header.from= (p=none dis=none)
header.from=
Return-Path:
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by
mx.zohomail.com
with SMTPS id 1571287066062229.83901714991384;
Wed, 16 Oct 2019 21:37:46 -0700 (PDT)
Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com
[10.5.11.14])
(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
(No client certificate requested)
by mx1.redhat.com (Postfix) with ESMTPS id 19AC93090FD1;
Thu, 17 Oct 2019 04:37: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 9E2845DA32;
Thu, 17 Oct 2019 04:37:40 +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 68FB64A486;
Thu, 17 Oct 2019 04:37:36 +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 x9H4V0sE005894 for ;
Thu, 17 Oct 2019 00:31:00 -0400
Received: by smtp.corp.redhat.com (Postfix)
id E6AE060C5D; Thu, 17 Oct 2019 04:31:00 +0000 (UTC)
Received: from mx1.redhat.com (ext-mx17.extmail.prod.ext.phx2.redhat.com
[10.5.110.46])
by smtp.corp.redhat.com (Postfix) with ESMTPS id 5E4C960BE1;
Thu, 17 Oct 2019 04:30:58 +0000 (UTC)
Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com
[209.85.222.174])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by mx1.redhat.com (Postfix) with ESMTPS id 29AD7300C22F;
Thu, 17 Oct 2019 04:30:57 +0000 (UTC)
Received: by mail-qk1-f174.google.com with SMTP id p10so665970qkg.8;
Wed, 16 Oct 2019 21:30:57 -0700 (PDT)
Received: from localhost.localdomain
([2804:431:c7cb:b2eb:4438:8ed0:10c8:ea71])
by smtp.gmail.com with ESMTPSA id
l129sm636219qkd.84.2019.10.16.21.30.53
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 16 Oct 2019 21:30:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=from:to:cc:subject:date:message-id:in-reply-to:references
:mime-version:content-transfer-encoding;
bh=lwVIrkCBEqepxcMuVWn/lkT0v/TwH5RKjZrGZBXNqsc=;
b=qjUlxPOhlUMhQHA2zTBUDsvnoMuK0hrgTf9jBRbTCDjpTQ9ut/hr8+BHvp4lC8Wd/t
CkvFCvm4vK3BnCvJ/SoiShz4mbDxx6XxTfn8Xk6L7CRFPZs1xek0EGkHkvgD+jD8N9B0
czXUeC9VX2BiM3hgByiJoaHWrw+lU1naD1pfJhIYX5KjYZu56fwzy36jDoe/RlY0jSg9
CQzcUhOYkiPaI5f3V4La6faQccorB7SH9cioCkdyd9ZD+XbI+lCBQGEwqkxB3RR6v1Vi
AzSCTOlYOCEHGi4oQ0XxYT7DTcMqtAGB4SKTOeNP6NDX5aO7qnMOHzHL/m1+ainC5GiC
W5IQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
:references:mime-version:content-transfer-encoding;
bh=lwVIrkCBEqepxcMuVWn/lkT0v/TwH5RKjZrGZBXNqsc=;
b=kuxHVf1eXDAWauc2OBsma+XeSQtXIWxiQhBetUF90lPO8D6wN18SulNj0SLTdzUaB5
fFrmwhTj7NkeBtfMMyqVayKaBQbH38/5zVxEUtmBA8y/J8FAshpogdfRWEr597VZbISq
uwjXyMDPK5sYQ8JFuOSA3A/Wyfnio1h+kW7XsD3PswevuEBEK00I+w8FL+utrfCG1aCi
v+ATFmWTtt/ZYHWQ4z/I6bJWuNej7YGcbcmt6jChyI0b2qJGj2SGRGe4rC5EBWsv/1Q8
e+OrDYGl5TUHTnCw8+urCKoxzdoUr8VTIo+XPk468ZoCqSjv310++tLV4tTsM2c07byv
sAWA==
X-Gm-Message-State: APjAAAXVX2AIV96UgbQxYaAL8Xk0TrAPCdcpoB9Ga1MkwadwyOirlR4d
cv5ngCV+Irl7WW5cPaZwfNSY2FjN
X-Google-Smtp-Source:
APXvYqwv6paxQWXcaBtXwqJAbRvXRJxEm0aoi9AYGp1c8K0rTkfu+ElbJAeB8B3BUI2+hpQYO/HKnQ==
X-Received: by 2002:a37:353:: with SMTP id 80mr1410590qkd.439.1571286655703;
Wed, 16 Oct 2019 21:30:55 -0700 (PDT)
From: jcfaracco@gmail.com
To: libvir-list@redhat.com
Date: Thu, 17 Oct 2019 01:30:31 -0300
Message-Id: <20191017043032.17123-2-jcfaracco@gmail.com>
In-Reply-To: <20191017043032.17123-1-jcfaracco@gmail.com>
References: <20191017043032.17123-1-jcfaracco@gmail.com>
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
(mx1.redhat.com [10.5.110.46]);
Thu, 17 Oct 2019 04:30:57 +0000 (UTC)
X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com
[10.5.110.46]);
Thu, 17 Oct 2019 04:30:57 +0000 (UTC) for IP:'209.85.222.174'
DOMAIN:'mail-qk1-f174.google.com'
HELO:'mail-qk1-f174.google.com' FROM:'jcfaracco@gmail.com' RCPT:''
X-RedHat-Spam-Score: -0.1 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU,
FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,
SPF_HELO_NONE,
SPF_PASS) 209.85.222.174 mail-qk1-f174.google.com 209.85.222.174
mail-qk1-f174.google.com
X-Scanned-By: MIMEDefang 2.84 on 10.5.110.46
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12
X-loop: libvir-list@redhat.com
Cc: Julio Faracco
Subject: [libvirt] [PATCH v4 1/2] conf: Add 'x' and 'y' resolution into
video XML definition
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: ,
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.14
X-Greylist: Sender IP whitelisted,
not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]);
Thu, 17 Oct 2019 04:37:44 +0000 (UTC)
X-ZohoMail-DKIM: fail (Header signature does not verify)
Content-Type: text/plain; charset="utf-8"
From: Julio Faracco
This commit adds resolution element with parameters 'x' and 'y' into video
XML domain group definition. Both, properties were added into an element
called 'resolution' and it was added inside 'model' element. They are set
as optional. This element does not follow QEMU properties 'xres' and
'yres' format. Both HTML documentation and schema were changed too. This
commit includes a simple test case to cover resolution for QEMU video
models. The new XML format for resolution looks like:
Signed-off-by: Julio Faracco
Reviewed-by: Cole Robinson
---
docs/formatdomain.html.in | 5 +-
docs/schemas/domaincommon.rng | 10 +++
src/conf/domain_conf.c | 63 ++++++++++++++++++-
src/conf/domain_conf.h | 5 ++
src/conf/virconftypes.h | 3 +
.../video-qxl-resolution.args | 32 ++++++++++
.../qemuxml2argvdata/video-qxl-resolution.xml | 40 ++++++++++++
tests/qemuxml2argvtest.c | 4 ++
.../video-qxl-resolution.xml | 40 ++++++++++++
tests/qemuxml2xmltest.c | 1 +
10 files changed, 201 insertions(+), 2 deletions(-)
create mode 100644 tests/qemuxml2argvdata/video-qxl-resolution.args
create mode 100644 tests/qemuxml2argvdata/video-qxl-resolution.xml
create mode 100644 tests/qemuxml2xmloutdata/video-qxl-resolution.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 500f114f41..962766b792 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -7077,7 +7077,10 @@ qemu-kvm -net nic,model=3D? /dev/null
vgamem (since 1.2.11) =
to set
the size of VGA framebuffer for fallback mode of QXL device.
Attribute vram64 (since 1.3.3=
)
- extends secondary bar and makes it addressable as 64bit memory.
+ extends secondary bar and makes it addressable as 64bit memory. =
For
+ resolution settings, there are x and y
+ (since 5.9.0) optional attributes t=
o set
+ minimum resolution for model.
=20
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index ead5a25068..e06f892da3 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -3656,6 +3656,16 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 2e6a113de3..88e93f6fb8 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -15345,6 +15345,52 @@ virDomainVideoAccelDefParseXML(xmlNodePtr node)
return def;
}
=20
+static virDomainVideoResolutionDefPtr
+virDomainVideoResolutionDefParseXML(xmlNodePtr node)
+{
+ xmlNodePtr cur;
+ virDomainVideoResolutionDefPtr def;
+ g_autofree char *x =3D NULL;
+ g_autofree char *y =3D NULL;
+
+ cur =3D node->children;
+ while (cur !=3D NULL) {
+ if (cur->type =3D=3D XML_ELEMENT_NODE) {
+ if (!x && !y &&
+ virXMLNodeNameEqual(cur, "resolution")) {
+ x =3D virXMLPropString(cur, "x");
+ y =3D virXMLPropString(cur, "y");
+ }
+ }
+ cur =3D cur->next;
+ }
+
+ if (!x || !y)
+ return NULL;
+
+ if (VIR_ALLOC(def) < 0)
+ goto cleanup;
+
+ if (x) {
+ if (virStrToLong_uip(x, NULL, 10, &def->x) < 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("cannot parse video x-resolution '%s'"), x);
+ goto cleanup;
+ }
+ }
+
+ if (y) {
+ if (virStrToLong_uip(y, NULL, 10, &def->y) < 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("cannot parse video y-resolution '%s'"), y);
+ goto cleanup;
+ }
+ }
+
+ cleanup:
+ return def;
+}
+
static virDomainVideoDriverDefPtr
virDomainVideoDriverDefParseXML(xmlNodePtr node)
{
@@ -15424,6 +15470,7 @@ virDomainVideoDefParseXML(virDomainXMLOptionPtr xml=
opt,
}
=20
def->accel =3D virDomainVideoAccelDefParseXML(cur);
+ def->res =3D virDomainVideoResolutionDefParseXML(cur);
}
if (virXMLNodeNameEqual(cur, "driver")) {
if (virDomainVirtioOptionsParseXML(cur, &def->virtio) < 0)
@@ -26515,6 +26562,18 @@ virDomainVideoAccelDefFormat(virBufferPtr buf,
virBufferAddLit(buf, "/>\n");
}
=20
+static void
+virDomainVideoResolutionDefFormat(virBufferPtr buf,
+ virDomainVideoResolutionDefPtr def)
+{
+ virBufferAddLit(buf, "x && def->y) {
+ virBufferAsprintf(buf, " x=3D'%u' y=3D'%u'",
+ def->x, def->y);
+ }
+ virBufferAddLit(buf, "/>\n");
+}
+
static int
virDomainVideoDefFormat(virBufferPtr buf,
virDomainVideoDefPtr def,
@@ -26562,11 +26621,13 @@ virDomainVideoDefFormat(virBufferPtr buf,
virBufferAsprintf(buf, " heads=3D'%u'", def->heads);
if (def->primary)
virBufferAddLit(buf, " primary=3D'yes'");
- if (def->accel) {
+ if (def->accel || def->res) {
virBufferAddLit(buf, ">\n");
virBufferAdjustIndent(buf, 2);
if (def->accel)
virDomainVideoAccelDefFormat(buf, def->accel);
+ if (def->res)
+ virDomainVideoResolutionDefFormat(buf, def->res);
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "\n");
} else {
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index edac6250e4..b33e5334f4 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1421,6 +1421,10 @@ struct _virDomainVideoAccelDef {
char *rendernode;
};
=20
+struct _virDomainVideoResolutionDef {
+ unsigned int x;
+ unsigned int y;
+};
=20
struct _virDomainVideoDriverDef {
virDomainVideoVGAConf vgaconf;
@@ -1438,6 +1442,7 @@ struct _virDomainVideoDef {
unsigned int heads;
bool primary;
virDomainVideoAccelDefPtr accel;
+ virDomainVideoResolutionDefPtr res;
virDomainVideoDriverDefPtr driver;
virDomainDeviceInfo info;
virDomainVirtioOptionsPtr virtio;
diff --git a/src/conf/virconftypes.h b/src/conf/virconftypes.h
index a15cfb5f9e..462842f324 100644
--- a/src/conf/virconftypes.h
+++ b/src/conf/virconftypes.h
@@ -324,6 +324,9 @@ typedef virDomainVcpuDef *virDomainVcpuDefPtr;
typedef struct _virDomainVideoAccelDef virDomainVideoAccelDef;
typedef virDomainVideoAccelDef *virDomainVideoAccelDefPtr;
=20
+typedef struct _virDomainVideoResolutionDef virDomainVideoResolutionDef;
+typedef virDomainVideoResolutionDef *virDomainVideoResolutionDefPtr;
+
typedef struct _virDomainVideoDef virDomainVideoDef;
typedef virDomainVideoDef *virDomainVideoDefPtr;
=20
diff --git a/tests/qemuxml2argvdata/video-qxl-resolution.args b/tests/qemux=
ml2argvdata/video-qxl-resolution.args
new file mode 100644
index 0000000000..1dbcd660f1
--- /dev/null
+++ b/tests/qemuxml2argvdata/video-qxl-resolution.args
@@ -0,0 +1,32 @@
+LC_ALL=3DC \
+PATH=3D/bin \
+HOME=3D/tmp/lib/domain--1-QEMUGuest1 \
+USER=3Dtest \
+LOGNAME=3Dtest \
+XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \
+QEMU_AUDIO_DRV=3Dnone \
+/usr/bin/qemu-system-i686 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \
+-m 214 \
+-realtime mlock=3Doff \
+-smp 1,sockets=3D1,cores=3D1,threads=3D1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni=
tor.sock,\
+server,nowait \
+-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \
+-rtc base=3Dutc \
+-no-shutdown \
+-no-acpi \
+-usb \
+-drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide=
0-0-0 \
+-device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b=
ootindex=3D1 \
+-device qxl-vga,id=3Dvideo0,ram_size=3D67108864,vram_size=3D67108864,vgame=
m_mb=3D8,\
+bus=3Dpci.0,addr=3D0x2 \
+-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3
diff --git a/tests/qemuxml2argvdata/video-qxl-resolution.xml b/tests/qemuxm=
l2argvdata/video-qxl-resolution.xml
new file mode 100644
index 0000000000..6ba2817002
--- /dev/null
+++ b/tests/qemuxml2argvdata/video-qxl-resolution.xml
@@ -0,0 +1,40 @@
+
+ QEMUGuest1
+ c7a5fdbd-edaf-9455-926a-d65c16db1809
+ 219136
+ 219136
+ 1
+
+ hvm
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu-system-i686
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 5212ce50bd..90edd7a844 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -2056,6 +2056,10 @@ mymain(void)
QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
QEMU_CAPS_DEVICE_QXL,
QEMU_CAPS_QXL_MAX_OUTPUTS);
+ DO_TEST("video-qxl-resolution",
+ QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
+ QEMU_CAPS_DEVICE_QXL,
+ QEMU_CAPS_QXL_VGAMEM);
DO_TEST("video-virtio-gpu-device",
QEMU_CAPS_DEVICE_VIRTIO_GPU,
QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
diff --git a/tests/qemuxml2xmloutdata/video-qxl-resolution.xml b/tests/qemu=
xml2xmloutdata/video-qxl-resolution.xml
new file mode 100644
index 0000000000..6ba2817002
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/video-qxl-resolution.xml
@@ -0,0 +1,40 @@
+
+ QEMUGuest1
+ c7a5fdbd-edaf-9455-926a-d65c16db1809
+ 219136
+ 219136
+ 1
+
+ hvm
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu-system-i686
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index b9364f942f..4c7ba98367 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -1210,6 +1210,7 @@ mymain(void)
QEMU_CAPS_DEVICE_QXL);
DO_TEST("video-qxl-heads", NONE);
DO_TEST("video-qxl-noheads", NONE);
+ DO_TEST("video-qxl-resolution", NONE);
DO_TEST("video-virtio-gpu-secondary", NONE);
DO_TEST("video-virtio-gpu-ccw",
QEMU_CAPS_CCW,
--=20
2.20.1
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
From nobody Tue Apr 30 19:39:07 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.zohomail.com;
dkim=fail;
spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as
permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com;
dmarc=fail(p=none dis=none) header.from=gmail.com
ARC-Seal: i=1; a=rsa-sha256; t=1571287176; cv=none;
d=zoho.com; s=zohoarc;
b=AyCSRN0kICAJO0lwfcDGZVHPSvk1rVzf2yIiIvuit/ReSjdVxGtxu4wj/b5WjPMMqA28CYT55jkCTCi4gzC3avR0pxlUi6u6yMJEVTokDwKbSzQLe5DahX5W0JvZTfs3kFjdVuDSiHKxhIZZ4vMW2dAmJmB8FgBMBLq3vJIrZEk=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com;
s=zohoarc;
t=1571287176;
h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To;
bh=u3DKDQwWckfKxswcjj395XNSH9LcS+/1VR238CtuWY0=;
b=B/JRU6PDWiE5Vy04L/SQjMLvKDrRFhNH1Zvr9yYzq+tFiEJlLkp4GDmDWot21lw9IxK9Yr4Mywx4buvrgWMwrEfkuWOEJohW+V8iZq2mJKFUF7BHRMM+2T0J0y6RvrPAIU1yctpjOrrzkidF2llEs64bldZ5fHg3LQ2DxFJ8qu4=
ARC-Authentication-Results: i=1; mx.zoho.com;
dkim=fail;
spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as
permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com;
dmarc=fail header.from= (p=none dis=none)
header.from=
Return-Path:
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by
mx.zohomail.com
with SMTPS id 1571287176491586.4215462522792;
Wed, 16 Oct 2019 21:39:36 -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 8841A89AC6;
Thu, 17 Oct 2019 04:39:34 +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 5DAB460C4E;
Thu, 17 Oct 2019 04:39:34 +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 1FEE718037CD;
Thu, 17 Oct 2019 04:39:34 +0000 (UTC)
Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com
[10.5.11.22])
by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
id x9H4Ux7w005883 for ;
Thu, 17 Oct 2019 00:30:59 -0400
Received: by smtp.corp.redhat.com (Postfix)
id CF4991001B20; Thu, 17 Oct 2019 04:30:59 +0000 (UTC)
Received: from mx1.redhat.com (ext-mx30.extmail.prod.ext.phx2.redhat.com
[10.5.110.71])
by smtp.corp.redhat.com (Postfix) with ESMTPS id C52B81001B03;
Thu, 17 Oct 2019 04:30:59 +0000 (UTC)
Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com
[209.85.222.193])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by mx1.redhat.com (Postfix) with ESMTPS id E1FFA1DBA;
Thu, 17 Oct 2019 04:30:58 +0000 (UTC)
Received: by mail-qk1-f193.google.com with SMTP id x134so705755qkb.0;
Wed, 16 Oct 2019 21:30:58 -0700 (PDT)
Received: from localhost.localdomain
([2804:431:c7cb:b2eb:4438:8ed0:10c8:ea71])
by smtp.gmail.com with ESMTPSA id
l129sm636219qkd.84.2019.10.16.21.30.55
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 16 Oct 2019 21:30:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=from:to:cc:subject:date:message-id:in-reply-to:references
:mime-version:content-transfer-encoding;
bh=wk6ZNN4jzdCUcbGxFB+hokvXEsvNvklKh1jU4N0jAKM=;
b=gDN6E9j3RiARoRs5E4UYi+erfj4DNI17xjF8wexAQCwJEntsBnQ1aYm1sLzhgUDAbJ
v0OibGFVISx+uLqPVEoioZDKlOSGWR7TQVBReb8LhbfbKAwCJts1uCO6tswsUk0Tn+P/
oQ3HUq8GIfyqcaX+O4JvEziQS8oJodn/N7fDAW14XZQ/8FeIvIhZiW8NlLUHpEnST/ym
Xj0RhWRYB+KxAhXTqmxBwfJacsI9B2dYVdng6wodnEt4+K2IHkRrA/Hm6IHomaNiJ7ln
8Av5sAlv+TdPozlO8HNyA7HuLyekUEqnMTRU/NFXBRhB2SKCrt+kMKx9N0pIPnMZs+cp
5nUA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
:references:mime-version:content-transfer-encoding;
bh=wk6ZNN4jzdCUcbGxFB+hokvXEsvNvklKh1jU4N0jAKM=;
b=AIh9ZJc6tOD79+i3A+sJxVN82kAEoflfSuyoMp1YLXpzGnDIG0R9x4HOrivG/nIR31
7P7BakLAG5lyUgypNv7t6hEevmOHTNvyB+Po3Jsj9vnab3JbyXrp7cVhy+7REoTnU41L
eEd1i1KohN6IkGKDpzxujB1tAWA5AV51deZ4/Szx3+5whVia6zUcUyYwG2B98sCmUAAe
icRoCAwEmpCIvhTDX5APV0RrzG6Wk9FoiSN6iDlRw8/NAPFhFi2cudKA/+4lALKeDyV+
6SWoGAPXo0+MZwZ8yOJLOXQKTtHf665xq9sH3Off9L0leF96roWoIFs7BsQq8VhBR+O6
Catw==
X-Gm-Message-State: APjAAAXB3ckvWWjm6TGh6016dBQ5Y3c1rWFsAX5SkBHgGPI/hGGmFaKs
6Cdi2eCnxn6ka2II6VXeGQ58Tx12
X-Google-Smtp-Source:
APXvYqy7nenl7JcoEFsUrpODhq6+92rgdpm+uSjl86B4vhLyNE9hPQwwRTJHyj0ntkMtEx0uJbY9iw==
X-Received: by 2002:a37:4a87:: with SMTP id x129mr1439849qka.43.1571286657637;
Wed, 16 Oct 2019 21:30:57 -0700 (PDT)
From: jcfaracco@gmail.com
To: libvir-list@redhat.com
Date: Thu, 17 Oct 2019 01:30:32 -0300
Message-Id: <20191017043032.17123-3-jcfaracco@gmail.com>
In-Reply-To: <20191017043032.17123-1-jcfaracco@gmail.com>
References: <20191017043032.17123-1-jcfaracco@gmail.com>
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2
(mx1.redhat.com [10.5.110.71]);
Thu, 17 Oct 2019 04:30:59 +0000 (UTC)
X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]);
Thu, 17 Oct 2019 04:30:59 +0000 (UTC) for IP:'209.85.222.193'
DOMAIN:'mail-qk1-f193.google.com'
HELO:'mail-qk1-f193.google.com' FROM:'jcfaracco@gmail.com' RCPT:''
X-RedHat-Spam-Score: -0.1 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU,
FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,
SPF_HELO_NONE,
SPF_PASS) 209.85.222.193 mail-qk1-f193.google.com 209.85.222.193
mail-qk1-f193.google.com
X-Scanned-By: MIMEDefang 2.84 on 10.5.110.71
X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22
X-loop: libvir-list@redhat.com
Cc: Julio Faracco
Subject: [libvirt] [PATCH v4 2/2] qemu: Generate 'xres' and 'yres' for QEMU
video devices
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: ,
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.26]);
Thu, 17 Oct 2019 04:39:35 +0000 (UTC)
X-ZohoMail-DKIM: fail (Header signature does not verify)
Content-Type: text/plain; charset="utf-8"
From: Julio Faracco
This commit let QEMU command line define 'xres' and 'yres' properties
if XML contains both properties from video model: based on resolution
fields 'x' and 'y'. There is a conditional structure inside
qemuDomainDeviceDefValidateVideo() that validates if video model
supports this feature. This commit includes the necessary changes to
cover resolution for 'video-qxl-resolution' test cases too.
Signed-off-by: Julio Faracco
Reviewed-by: Cole Robinson
---
src/qemu/qemu_command.c | 5 +++++
src/qemu/qemu_domain.c | 11 +++++++++++
tests/qemuxml2argvdata/video-qxl-resolution.args | 2 +-
tests/qemuxml2argvdata/video-qxl-resolution.xml | 4 +++-
tests/qemuxml2xmloutdata/video-qxl-resolution.xml | 4 +++-
5 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index e98195b1d7..b579b994f3 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4598,6 +4598,11 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
virBufferAsprintf(&buf, ",vgamem=3D%uk", video->vram);
}
=20
+ if (video->res && video->res->x && video->res->y) {
+ /* QEMU accepts resolution xres and yres. */
+ virBufferAsprintf(&buf, ",xres=3D%u,yres=3D%u", video->res->x, vid=
eo->res->y);
+ }
+
if (qemuBuildDeviceAddressStr(&buf, def, &video->info, qemuCaps) < 0)
return NULL;
=20
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 09b6c9a570..a97bf65e7f 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5774,6 +5774,17 @@ qemuDomainDeviceDefValidateVideo(const virDomainVide=
oDef *video)
}
}
=20
+ if (video->type !=3D VIR_DOMAIN_VIDEO_TYPE_VGA &&
+ video->type !=3D VIR_DOMAIN_VIDEO_TYPE_QXL &&
+ video->type !=3D VIR_DOMAIN_VIDEO_TYPE_VIRTIO &&
+ video->type !=3D VIR_DOMAIN_VIDEO_TYPE_BOCHS) {
+ if (video->res) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("model resolution is not supported"));
+ return -1;
+ }
+ }
+
if (video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_VGA ||
video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_VMVGA) {
if (video->vram && video->vram < 1024) {
diff --git a/tests/qemuxml2argvdata/video-qxl-resolution.args b/tests/qemux=
ml2argvdata/video-qxl-resolution.args
index 1dbcd660f1..ed2e4422da 100644
--- a/tests/qemuxml2argvdata/video-qxl-resolution.args
+++ b/tests/qemuxml2argvdata/video-qxl-resolution.args
@@ -28,5 +28,5 @@ server,nowait \
-drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide=
0-0-0 \
-device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b=
ootindex=3D1 \
-device qxl-vga,id=3Dvideo0,ram_size=3D67108864,vram_size=3D67108864,vgame=
m_mb=3D8,\
-bus=3Dpci.0,addr=3D0x2 \
+xres=3D1280,yres=3D720,bus=3Dpci.0,addr=3D0x2 \
-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3
diff --git a/tests/qemuxml2argvdata/video-qxl-resolution.xml b/tests/qemuxm=
l2argvdata/video-qxl-resolution.xml
index 6ba2817002..1bc415f3f8 100644
--- a/tests/qemuxml2argvdata/video-qxl-resolution.xml
+++ b/tests/qemuxml2argvdata/video-qxl-resolution.xml
@@ -30,7 +30,9 @@
diff --git a/tests/qemuxml2xmloutdata/video-qxl-resolution.xml b/tests/qemu=
xml2xmloutdata/video-qxl-resolution.xml
index 6ba2817002..1bc415f3f8 100644
--- a/tests/qemuxml2xmloutdata/video-qxl-resolution.xml
+++ b/tests/qemuxml2xmloutdata/video-qxl-resolution.xml
@@ -30,7 +30,9 @@
--=20
2.20.1
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list