From nobody Mon Apr 29 20:44: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; 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 1503069730997664.6936554714488; Fri, 18 Aug 2017 08:22:10 -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 2BC855F7B8; Fri, 18 Aug 2017 15:22:04 +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 94EB75D962; Fri, 18 Aug 2017 15:22:03 +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 80D144EBDD; Fri, 18 Aug 2017 15:22:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v7IFJscL017799 for ; Fri, 18 Aug 2017 11:19:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 269474CB; Fri, 18 Aug 2017 15:19:54 +0000 (UTC) Received: from dnr.brq.redhat.com (unknown [10.34.247.176]) by smtp.corp.redhat.com (Postfix) with ESMTP id 834576A30A for ; Fri, 18 Aug 2017 15:19:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2BC855F7B8 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Fri, 18 Aug 2017 17:19:48 +0200 Message-Id: <408cada38425a0ff0554e5a9e4d24b717950aee1.1503069587.git.jtomko@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] conf: useserial: drop useless check for serial 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: , 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 18 Aug 2017 15:22:05 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Since its introduction in commit 874e65aa, if someone requests: we report an error if we cannot successfully count the number of serial devices via an XPath query. Instead of fixing the check (and moving it to the validation phase, to prevent existing domains from disappearing), drop it completely. For QEMU, the number of serials is checked when building the command line. --- src/conf/domain_conf.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 3bef5bed3..e563007ba 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -16127,7 +16127,7 @@ virDomainDefParseBootXML(xmlXPathContextPtr ctxt, int n; char *tmp =3D NULL; int ret =3D -1; - unsigned long deviceBoot, serialPorts; + unsigned long deviceBoot; =20 if (virXPathULong("count(./devices/disk[boot]" "|./devices/interface[boot]" @@ -16204,18 +16204,10 @@ virDomainDefParseBootXML(xmlXPathContextPtr ctxt, if ((node =3D virXPathNode("./os/bios[1]", ctxt))) { tmp =3D virXMLPropString(node, "useserial"); if (tmp) { - if (STREQ(tmp, "yes")) { - if (virXPathULong("count(./devices/serial)", - ctxt, &serialPorts) < 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("need at least one serial port " - "for useserial")); - goto cleanup; - } + if (STREQ(tmp, "yes")) def->os.bios.useserial =3D VIR_TRISTATE_BOOL_YES; - } else { + else def->os.bios.useserial =3D VIR_TRISTATE_BOOL_NO; - } VIR_FREE(tmp); } =20 --=20 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list