From nobody Mon Apr 29 19:37:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 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=1571543157; cv=none; d=zoho.com; s=zohoarc; b=NfbGUMCaqO6LncrzccntYERqWnmGG9S3/zpdu4w2Jj4HAzMA0sunU2v+kDNZCD8eOjxuOFOeskIy2P/2HxNbeahubysiEeYtNrK5IAC+efoP31M3xXocByIHDQp/HhdR0QOkbfOshcqTO7uQQdz5c9vlQQTRsawW1+whEwKug20= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571543157; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=joY2CHuqC7GmgiMhkIzpBAc2cuogaqyMQWr2itEm1Bc=; b=YcPWsomaqJvme6skeWXiQFcVi+WkbOWglFzT0yCwjSa9ze43BUx8pheXTOiNS0WI2KbylyIw+ScD8mMfyzp8t8kQUpD10FI+pM2DiP+HKNMClzdcMr7r2Hx7nrOc/uoIfIEVabu5r12n9xIyaud7Z8Sqh38Fu5A5NY6CnUuiAjg= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1571543157124411.8549690077956; Sat, 19 Oct 2019 20:45:57 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-174-J6Q5CDqNMtuwuPIZnDOHFQ-1; Sat, 19 Oct 2019 23:45:52 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 07D7380183E; Sun, 20 Oct 2019 03:45:44 +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 1143019C7F; Sun, 20 Oct 2019 03:45:38 +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 81CA64E58A; Sun, 20 Oct 2019 03:45:33 +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 x9K3jVbo002857 for ; Sat, 19 Oct 2019 23:45:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 456FC60BFB; Sun, 20 Oct 2019 03:45:31 +0000 (UTC) Received: from mx1.redhat.com (ext-mx21.extmail.prod.ext.phx2.redhat.com [10.5.110.62]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3D57A60BF4 for ; Sun, 20 Oct 2019 03:45:28 +0000 (UTC) Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.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 A779D18C4266 for ; Sun, 20 Oct 2019 03:45:26 +0000 (UTC) Received: by mail-qt1-f193.google.com with SMTP id w14so15271750qto.9 for ; Sat, 19 Oct 2019 20:45:26 -0700 (PDT) Received: from localhost.localdomain ([2804:431:c7cb:e57e:c47:64a3:3477:d8b0]) by smtp.gmail.com with ESMTPSA id c8sm5096927qko.102.2019.10.19.20.45.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Oct 2019 20:45:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571543155; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=joY2CHuqC7GmgiMhkIzpBAc2cuogaqyMQWr2itEm1Bc=; b=DNMqWvhhYrm8m2g+ZyygmzA9gs5pm2j7DNk7RyhPUVO7MbV0Yg20JtRhc/m62E2x4Rjz9n 6knTbYC8wrlkBK7RRnmdAocfzUbniDaMseT8MXYdMHm2ykNyavoALHOZ9ziYsucD9QtSiY UXUyEoZgEoU0G88JJEutOSB1slw64I8= 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:mime-version :content-transfer-encoding; bh=wPrKkrKmhrJK9vYKYLeMw3/VBBPoGAj2C8HrMpTpb1k=; b=tlMbWj5zEZROJfmCKxQQV7+T05L/blaJCkYjz4P3IffLiJVTLtY5fE0yvDsAjeWnxu GNLmeSLze1dr3FgahKn9nltYP81MJhKZw1B6UYe2R0EyhD8xoJJbTFz7rILx/4NyHmVB Vrsz5K8G9/uTWu9i51bjPDaguWF6nCkxCPpIPRteaUq4r02QHYSUPtdnvqXiAPBdVbFf 5tJ0y/KBjhqDqErvmC4L1vsXkUGSxicF+fwfDqlUC0ljOgPmxG8jYmcThzKRzAoGcGg6 svGiQpThXMX6JEfdiLNFYzFkFL8srB5gg+e20Fk1iuaOR9ZDvjatkbBPWuwV+fJCYf+I DVFA== X-Gm-Message-State: APjAAAVXntRMMNLZWrqvS8wpkDsa+Og1vCDho3/O96HtNPltj6yXie0M DwR1FFhyr1Q6l2u/nq6ZkkkbS7gq X-Google-Smtp-Source: APXvYqxbO+VDzL1PDGi+5k2aLMzzicmfJtG3VsLifv/Q6dc9Hg9ZVhAa0mzEqgUy4wTyDl/oh+jg7w== X-Received: by 2002:a05:6214:110c:: with SMTP id e12mr18154141qvs.164.1571543125353; Sat, 19 Oct 2019 20:45:25 -0700 (PDT) From: jcfaracco@gmail.com To: libvir-list@redhat.com Date: Sun, 20 Oct 2019 00:45:20 -0300 Message-Id: <20191020034520.29721-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.62]); Sun, 20 Oct 2019 03:45:26 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Sun, 20 Oct 2019 03:45:26 +0000 (UTC) for IP:'209.85.160.193' DOMAIN:'mail-qt1-f193.google.com' HELO:'mail-qt1-f193.google.com' FROM:'jcfaracco@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.097 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS) 209.85.160.193 mail-qt1-f193.google.com 209.85.160.193 mail-qt1-f193.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.62 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Julio Faracco Subject: [libvirt] [PATCH] conf: Do not validate resolution XML if 'x' or/and 'y' are 0. 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: J6Q5CDqNMtuwuPIZnDOHFQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Julio Faracco There is an issue with when of 'x' or 'y' settings are 0. Function virDomainVideoResolutionDefParseXML() will validate this XML, but both 'x' and 'y' will be removed. One example, if someone defines this settings: After applying this settings, funcion libvirt will remove both resolutions because virDomainVideoResolutionDefFormat() requires 'x' and 'y' higher than 0. So, the example above will become: Now, libvirt only adds with 'x' and 'y' if boths strings are not NULL AND they are higher than 0. Signed-off-by: Julio Faracco --- src/conf/domain_conf.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 88e93f6fb8..d89d8059ce 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15375,7 +15375,7 @@ virDomainVideoResolutionDefParseXML(xmlNodePtr node) if (virStrToLong_uip(x, NULL, 10, &def->x) < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("cannot parse video x-resolution '%s'"), x); - goto cleanup; + goto error; } } =20 @@ -15383,12 +15383,21 @@ virDomainVideoResolutionDefParseXML(xmlNodePtr no= de) if (virStrToLong_uip(y, NULL, 10, &def->y) < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("cannot parse video y-resolution '%s'"), y); - goto cleanup; + goto error; } } =20 + /* QEMU ignores 'xres' or/and 'yres' with value 0. */ + if (!def->x || !def->y) + goto error; + cleanup: return def; + + error: + VIR_FREE(def); + def =3D NULL; + goto cleanup; } =20 static virDomainVideoDriverDefPtr --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list