From nobody Sun Feb 8 22:06:13 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; 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 --- 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 @@