From nobody Sun Feb 8 19:24:30 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1533822347580181.40764504077265; Thu, 9 Aug 2018 06:45:47 -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 86CE7256A; Thu, 9 Aug 2018 13:45:45 +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 3BBBA7555A; Thu, 9 Aug 2018 13:45:45 +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 C01A624F63; Thu, 9 Aug 2018 13:45:44 +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 w79DiP9w015085 for ; Thu, 9 Aug 2018 09:44:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 229332314D; Thu, 9 Aug 2018 13:44:25 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id B62672314E for ; Thu, 9 Aug 2018 13:44:24 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Thu, 9 Aug 2018 15:44:09 +0200 Message-Id: <86cfa395075d5d8f8c69f936e366a0fa6b872549.1533822163.git.phrdina@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 14/17] vircgroup: machinename will never be NULL 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.30]); Thu, 09 Aug 2018 13:45:46 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Commit moved machineName generation before virCgroupNewDetectMachine() is called. Signed-off-by: Pavel Hrdina --- src/util/vircgroup.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index 99cbdaa59b..84f5c4197f 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -266,27 +266,22 @@ virCgroupValidateMachineGroup(virCgroupPtr group, if (virCgroupPartitionEscape(&partname) < 0) return false; =20 - if (machinename && - (virAsprintf(&partmachinename, "%s.libvirt-%s", - machinename, drivername) < 0 || - virCgroupPartitionEscape(&partmachinename) < 0)) + if (virAsprintf(&partmachinename, "%s.libvirt-%s", + machinename, drivername) < 0 || + virCgroupPartitionEscape(&partmachinename) < 0) return false; =20 if (!(scopename_old =3D virSystemdMakeScopeName(name, drivername, true= ))) return false; =20 - /* We should keep trying even if this failed */ - if (!machinename) - virResetLastError(); - else if (!(scopename_new =3D virSystemdMakeScopeName(machinename, - drivername, false))) + if (!(scopename_new =3D virSystemdMakeScopeName(machinename, + drivername, false))) return false; =20 if (virCgroupPartitionEscape(&scopename_old) < 0) return false; =20 - if (scopename_new && - virCgroupPartitionEscape(&scopename_new) < 0) + if (virCgroupPartitionEscape(&scopename_new) < 0) return false; =20 for (i =3D 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { @@ -315,16 +310,16 @@ virCgroupValidateMachineGroup(virCgroupPtr group, tmp++; =20 if (STRNEQ(tmp, name) && - STRNEQ_NULLABLE(tmp, machinename) && + STRNEQ(tmp, machinename) && STRNEQ(tmp, partname) && - STRNEQ_NULLABLE(tmp, partmachinename) && + STRNEQ(tmp, partmachinename) && STRNEQ(tmp, scopename_old) && - STRNEQ_NULLABLE(tmp, scopename_new)) { + STRNEQ(tmp, scopename_new)) { VIR_DEBUG("Name '%s' for controller '%s' does not match " "'%s', '%s', '%s', '%s' or '%s'", tmp, virCgroupControllerTypeToString(i), - name, NULLSTR(machinename), partname, - scopename_old, NULLSTR(scopename_new)); + name, machinename, partname, + scopename_old, scopename_new); return false; } } --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list