From nobody Sun Feb 8 22:05:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1620039578; cv=none; d=zohomail.com; s=zohoarc; b=dVyklXGW790Iz4LalJEtjgSAO1lydDDL/2UP9PKnFwAQrNUV1she9Mr6GYAqa8dXCke4ug4tXT291dvcH094yUojlKqnMqaibz2sEmeIVpVDKsaRU2wJAoknJoJj/gH291NixA52W0sTVGS5ccRmMXGDDTA0BHI8QQnbgKlmODc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620039578; 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=pJIBQKjzaBq2ayDJ4aeGbI1HPUReW+rwmvPrCIFZkzM=; b=f6EnjAHVzqcziOxOO+Q57tPvGzN2lePdlM1UTRLhiWbeV9OEjIHF7mQkcmX/KvnEneyM0V/ciIHzPL6ngXW9MYQ3KBqZtk5ZZ3hlft4PZBBP12+t4hEdWLtIsZP4CEzbpCa3uyHa/KScF+fB5JrkOQiiLZR6bV/Azxi3GbJtp2Y= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1620039578238828.1022325650736; Mon, 3 May 2021 03:59:38 -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-121-BP8pQc4vNZSiRZQJINp9sQ-1; Mon, 03 May 2021 06:59:35 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2CDF3800D62; Mon, 3 May 2021 10:59:29 +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 EE7635C559; Mon, 3 May 2021 10:59:26 +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 7A2A155346; Mon, 3 May 2021 10:59:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 143AxPcp005960 for ; Mon, 3 May 2021 06:59:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0C1521D0AC; Mon, 3 May 2021 10:59:25 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 05F8B1D0B0 for ; Mon, 3 May 2021 10:59:22 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 228CD18E0920 for ; Mon, 3 May 2021 10:59:22 +0000 (UTC) Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [85.215.255.25]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-427-7DjJ2WNMPKmZgd2cRwdlgA-1; Mon, 03 May 2021 06:59:19 -0400 Received: from sender by smtp.strato.de (RZmta 47.25.4 AUTH) with ESMTPSA id m06458x43AuK0m1 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Mon, 3 May 2021 12:56:20 +0200 (CEST) X-MC-Unique: BP8pQc4vNZSiRZQJINp9sQ-1 X-MC-Unique: 7DjJ2WNMPKmZgd2cRwdlgA-1 X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzpIG0mv9coXAgtl+1b1FMstFZvCqIQN5N7TvWFg4vzhFVdoKAuQ" X-RZG-CLASS-ID: mo00 From: Olaf Hering To: libvir-list@redhat.com Subject: [PATCH v1 2/4] libxl: remove obsolete check for result of xc_get_max_cpus Date: Mon, 3 May 2021 12:56:11 +0200 Message-Id: <20210503105613.19554-3-olaf@aepfle.de> In-Reply-To: <20210503105613.19554-1-olaf@aepfle.de> References: <20210503105613.19554-1-olaf@aepfle.de> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Olaf Hering 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.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" xc_get_max_cpus from Xen version 4.3 may return 0 in case xc_physinfo fails. This has been fixed in Xen 4.4. Remove the obsolete result check from libvirt. Just convert libxl error codes to plain -1. Signed-off-by: Olaf Hering Reviewed-by: Jim Fehlig --- src/libxl/libxl_driver.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index cf3ee4db3d..99a170ff2a 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -972,11 +972,7 @@ libxlConnectGetMaxVcpus(virConnectPtr conn, const char= *type G_GNUC_UNUSED) =20 cfg =3D libxlDriverConfigGet(driver); ret =3D libxl_get_max_cpus(cfg->ctx); - /* On failure, libxl_get_max_cpus() will return ERROR_FAIL from Xen 4.4 - * onward, but it ever returning 0 is obviously wrong too (and it is - * what happens, on failure, on Xen 4.3 and earlier). Therefore, a 'le= ss - * or equal' is the catchall we want. */ - if (ret <=3D 0) + if (ret < 0) ret =3D -1; =20 virObjectUnref(cfg);