From nobody Mon Apr 29 01:05:15 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=1676474598; cv=none; d=zohomail.com; s=zohoarc; b=LWWnnMPnpNZ/yvI1sHlOx1hllHVZ9mOme7pME1bjugbbsGRFqYLMN5rz1Dix2TZRxz6eoV5UZe60wtNTpJPR8kuPERsKkTs+kBW5kzwtedOtrkEvIGnglhqLCHjAxzuvnYdQaCFXoGnJm2qG5LBjKWeGUxF12MNSLSH/FdqOgvE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676474598; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=41EsP6p/aa6pa97Jt8lZX4H7FexFEfcWiK2NC8X3Bcc=; b=YzKdAW7HoAbS0C61qM1f+cO5ksFdkYERkY3NT1UuxRiTOed1UyPRAr3sc5LsWdK+v8TT9X/9M6IVjy5O0OQbSMEZIHc/g12rcv3d1xtLbyy5N1jkKfuO0i7+42D3VfA5TUF5c6aNl8t8TQ0Uq1Qu9n9qOEU0GU7wM3AXxou6exI= 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 1676474598022814.2272426815075; Wed, 15 Feb 2023 07:23:18 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-277-oxr-tmciPxSWPDHCdJ5n_g-1; Wed, 15 Feb 2023 10:23:07 -0500 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 32173802C18; Wed, 15 Feb 2023 15:23:00 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 379BA492B0E; Wed, 15 Feb 2023 15:22:57 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0C6CE1946589; Wed, 15 Feb 2023 15:22:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E6C6D1946588 for ; Wed, 15 Feb 2023 15:22:55 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D6AFD2166B31; Wed, 15 Feb 2023 15:22:55 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.40.23.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 751E62166B30 for ; Wed, 15 Feb 2023 15:22:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676474597; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=41EsP6p/aa6pa97Jt8lZX4H7FexFEfcWiK2NC8X3Bcc=; b=Dd0NPimImLI302K3fi1HV4BITiSVQ9rgru52KMDYRqpJtkb830sm6XsNdRrobg5Jp52ohU CWXo83jI0Cgc/hNmoe6ZxPavZzfvc2jytjqaxlutqADPLOVgooGSxiuTs94cM8oo7Phet9 N+SeAqNqwj9ywwk881phZRWW9Bcq2pY= X-MC-Unique: oxr-tmciPxSWPDHCdJ5n_g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] qemu_extdevice: Add a comment into qemuExtDevicesSetupCgroup() Date: Wed, 15 Feb 2023 16:22:51 +0100 Message-Id: <5eb7cfbdc5e3f243a7274f7e53110fcc8f4e2967.1676474571.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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: 1676474599261100005 Content-Type: text/plain; charset="utf-8"; x-default="true" The way setting up CGroups for external helpers work, is: qemuExtDevicesHasDevice() is called first to determine whether there is a helper process running, the CGroup controller is created and then qemuExtDevicesSetupCgroup() is called to place helpers into the CGroup. But when one reads just qemuExtDevicesSetupCgroup() it's easy to miss this hidden logic. Therefore, add a warning at the beginning of the function. Signed-off-by: Michal Privoznik Reviewed-by: Laine Stump --- src/qemu/qemu_extdevice.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_extdevice.c b/src/qemu/qemu_extdevice.c index 47e97f3565..1c397972e4 100644 --- a/src/qemu/qemu_extdevice.c +++ b/src/qemu/qemu_extdevice.c @@ -331,6 +331,9 @@ qemuExtDevicesSetupCgroup(virQEMUDriver *driver, virDomainDef *def =3D vm->def; size_t i; =20 + /* Don't forget to adjust qemuExtDevicesHasDevice() accordingly. + * Otherwise, this function might not be called at all. */ + if (qemuDBusSetupCgroup(driver, vm, cgroup) < 0) return -1; =20 --=20 2.39.1