From nobody Wed May 8 11:53:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633532607; cv=none; d=zohomail.com; s=zohoarc; b=bQOXBgFR7UdtNRucl7VAAGz2Y8jl9TfX8JKMajQcPZoyQEm9B5LHjYq7ryD6JbFKqBWnVwBeRt8C4b+gu+CHxYFxtP7zxxx+RtaNKPVzEeKEoZ0bkD1ianG3xK6nWUZIpaSSW1dOIgOf6wYy3eji6CKgu1+hFwUtDncJwuJjxZU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633532607; 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=r+pDf/EC3tpd1oo6jh/iPRnZUp3WYs+ideQnSaaftJM=; b=kXIs1ISUPBgWZszsUM/as6wtEeX9NgDLMZY2t0mwidKaVKcRyptmecOGhabZx5gvKXyw795gBPPyUIy+jsUZmgmwuznCN4yE95DOGLHsCXxReAVdOoaAUv3ER4Nh0aBHoxKIGdbvXaGaVjrlOV85kC5ImhSsisg0VcQtGrEeZYw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1633532607629822.3616377231643; Wed, 6 Oct 2021 08:03:27 -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-31-Z6M0C3MjMf-USz0wFA01AQ-1; Wed, 06 Oct 2021 11:03:21 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 20DA91808310; Wed, 6 Oct 2021 15:03:16 +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 388585D9C6; Wed, 6 Oct 2021 15:03:14 +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 92C081806D00; Wed, 6 Oct 2021 15:03:11 +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 196Epo0Y027345 for ; Wed, 6 Oct 2021 10:51:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3F17510074EF; Wed, 6 Oct 2021 14:51:50 +0000 (UTC) Received: from worklaptop.redhat.com (unknown [10.22.19.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id AD2EC10013D7; Wed, 6 Oct 2021 14:51:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633532606; 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=r+pDf/EC3tpd1oo6jh/iPRnZUp3WYs+ideQnSaaftJM=; b=hhTf+lgBE1Rd2chWXYZrjcXjmcLdvVsmUXLCycAhmFPWG9S4xOArNf7ZIwqhu8543FV5nj PebpKQsL38FtBur08JhyubcrMU5ft4H1lkQQV0L9TvtwmbkEux6YtnDg4RVp456nngBZp5 IRsJI5I/Fy/2BzmwmamhA0CCbuTpX80= X-MC-Unique: Z6M0C3MjMf-USz0wFA01AQ-1 From: Cole Robinson To: libvir-list@redhat.com Subject: [PATCH] lxc: controller: Fix container launch on cgroup v1 Date: Wed, 6 Oct 2021 10:51:36 -0400 Message-Id: <820a11af075479ee562e3185939219b7316935ba.1633531847.git.crobinso@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Michal Privoznik , Cole Robinson 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.14 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 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633532617194100001 Content-Type: text/plain; charset="utf-8" With cgroup v1 I'm seeing LXC container startup failures: $ sudo virt-install --connect lxc:/// --name test-container --memory 128 --boot init=3D/bin/sh Starting install... ERROR error from service: GDBus.Error:org.freedesktop.machine1.NoMachineForPID: PID 2145047 does not belong to any known machine libvirt 7.0.0 works but 7.1.0+ does not. The root error seems to predate that, showing up in syslog, but commit 9c1693eff made it fatal: commit 9c1693eff427661616ce1bd2795688f87288a412 Author: Pavel Hrdina Date: Fri Feb 5 16:17:35 2021 +0100 vircgroup: use DBus call to systemd for some APIs The error comes from virSystemdGetMachineByPID. The PID that shows up in the above error message does not match the leader PID as reported by machinectl. This change fixes the error. Things seem to continue to work with cgroupsv2 after this change. https://gitlab.com/libvirt/libvirt/-/issues/182 Signed-off-by: Cole Robinson Reviewed-by: Michal Privoznik Tested-by: Jim Fehlig --- This is from the thread in August, posted as non RFC now src/lxc/lxc_controller.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 8953e0c904..444f728af4 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -865,12 +865,12 @@ static int virLXCControllerSetupCgroupLimits(virLXCCo= ntroller *ctrl) nodeset =3D virDomainNumatuneGetNodeset(ctrl->def->numa, auto_nodeset,= -1); =20 if (!(ctrl->cgroup =3D virLXCCgroupCreate(ctrl->def, - ctrl->initpid, + getpid(), ctrl->nnicindexes, ctrl->nicindexes))) goto cleanup; =20 - if (virCgroupAddMachineProcess(ctrl->cgroup, getpid()) < 0) + if (virCgroupAddMachineProcess(ctrl->cgroup, ctrl->initpid) < 0) goto cleanup; =20 /* Add all qemu-nbd tasks to the cgroup */ --=20 2.31.1