From nobody Fri Dec 19 04:17:21 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1658918118; cv=none; d=zohomail.com; s=zohoarc; b=W6il/RqwqMfeGD7OhCwDsdzFqKg/lW2Y1tAQHCN9T9q4yqRhzfZ86qpY3LtA+NeH4NVEFjRYz23p2Q7CSWu3gf/MlRIF9g1Zvpgl6BEo30CuDI0SjtLHfCl/oyBpUYnd/7q+YczwzZZC/0ZeO75ECeueGP9ENnDGuYV6lnoZH60= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658918118; 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=ubX8ZCUVdm+9KBj2nUqi3rHiyUOBhdLYJ+cczrTcS5E=; b=d/DzsxwO4CtdHKSy4beSNK2qNT/MEewv9/cOEtAQyZe+uFwCQWtqUYkZMDFu1mbcy60sAqXDmeeHigKYyLi2U/aMcKInOur3G3YMZEOITTWXcyVT2sS1RRULmbdHGYujXenp3CZHWTioAXGIRnFMRy/YawTcCBQVdnQUtsg26r8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1658918118428454.76098918596335; Wed, 27 Jul 2022 03:35:18 -0700 (PDT) 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-376-AYQzG-SzMKGySzUulUs_4g-1; Wed, 27 Jul 2022 06:35:14 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B88E48039B7; Wed, 27 Jul 2022 10:35:12 +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 A262C40CF8E2; Wed, 27 Jul 2022 10:35:12 +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 4EAE81945D99; Wed, 27 Jul 2022 10:35:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4423F1945D9C for ; Wed, 27 Jul 2022 10:35:10 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 38F08C28125; Wed, 27 Jul 2022 10:35:10 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.88]) by smtp.corp.redhat.com (Postfix) with ESMTP id 854EAC28100; Wed, 27 Jul 2022 10:35:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658918116; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ubX8ZCUVdm+9KBj2nUqi3rHiyUOBhdLYJ+cczrTcS5E=; b=LxT6FCrlHhpkZTG/BIPM5oIxIBue6PYa/C9WWtVNaWzNlWaG1sY1bh5KE6NL+ut4uOFN3z rf7oeikwCEU+ZzK9cpy/6kD2CKm51uuoqOZiRhxGNTY79kiJeQYLg0j/oOakQfoy4k5xuQ 17oE66hSj+AKPbPEv1HY2Kk19Msv1Zs= X-MC-Unique: AYQzG-SzMKGySzUulUs_4g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v14 06/15] qemu_cgroup: Don't ignore ENOENT in qemuCgroupAllowDevicesPaths() Date: Wed, 27 Jul 2022 12:34:52 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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: , Cc: lin.a.yang@intel.com, jian-feng.ding@intel.com, haibin.huang@intel.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: 1658918119424100001 Content-Type: text/plain; charset="utf-8"; x-default="true" There's no need to skip over ENOENT error in qemuCgroupAllowDevicesPaths(). The path must exists when qemuCgroupAllowDevicePath() is called because of virFileExists() check done right above. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/qemu/qemu_cgroup.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index 51702b52e1..d6f27a5a4d 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -76,16 +76,12 @@ qemuCgroupAllowDevicesPaths(virDomainObj *vm, size_t i; =20 for (i =3D 0; deviceACL[i] !=3D NULL; i++) { - int rv; - if (!virFileExists(deviceACL[i])) { VIR_DEBUG("Ignoring non-existent device %s", deviceACL[i]); continue; } =20 - rv =3D qemuCgroupAllowDevicePath(vm, deviceACL[i], perms, ignoreEa= cces); - if (rv < 0 && - !virLastErrorIsSystemErrno(ENOENT)) + if (qemuCgroupAllowDevicePath(vm, deviceACL[i], perms, ignoreEacce= s) < 0) return -1; } =20 --=20 2.35.1