From nobody Tue Feb 10 14:49:41 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 ARC-Seal: i=1; a=rsa-sha256; t=1567188194; cv=none; d=zoho.com; s=zohoarc; b=g7xSBJ78EktZ+V+NIaYEFiwOzwoZdleCFjjdc6lFguDV875GeM/Yet4UWBPUeyvcXVuAZkybjPE3WXWcuB7IDlZAnJT+HO2FGnJBEwWLFlWzFCdHxoTVDRD8C4kf/kypmPqXQy3tfRHdgmvhuYw3QASrXfIW68FTDU9iaplFCQY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567188194; 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:ARC-Authentication-Results; bh=Aa2srCcf9kDYADXIZUaFgo3OH37cEuKM5wGaRNBVZek=; b=VZu2o/EUQp0EqWkQsBzyIKzmPbKeK4ajw8zQFePbAPl50fK/Htj0jktHIhgFUR7RWl8PdKHGAR2MIbE/aksBPS9egmrfe+ltP4fTdV0QghGW3/rrrvXrwERy9NZ9EhgOG/6T6Hj/oSiPVCr5xn4HkSdQqEHes8+NHn+cfWKYAWo= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1567188194334347.43603220953264; Fri, 30 Aug 2019 11:03:14 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3A7CB300D21B; Fri, 30 Aug 2019 18:03:13 +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 135CE60606; Fri, 30 Aug 2019 18:03:13 +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 B9A3624F33; Fri, 30 Aug 2019 18:03:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7UI3B0R031236 for ; Fri, 30 Aug 2019 14:03:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 407125DE5B; Fri, 30 Aug 2019 18:03:11 +0000 (UTC) Received: from localhost (ovpn-112-53.ams2.redhat.com [10.36.112.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id B13005DC18; Fri, 30 Aug 2019 18:03:00 +0000 (UTC) From: marcandre.lureau@redhat.com To: libvir-list@redhat.com Date: Fri, 30 Aug 2019 22:01:48 +0400 Message-Id: <20190830180202.22278-6-marcandre.lureau@redhat.com> In-Reply-To: <20190830180202.22278-1-marcandre.lureau@redhat.com> References: <20190830180202.22278-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , jtomko@redhat.com Subject: [libvirt] [PATCH v3 05/19] qemu-cgroup: allow accel rendernode access 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: , Content-Type: text/plain; charset="utf-8" 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Fri, 30 Aug 2019 18:03:13 +0000 (UTC) From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_cgroup.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index ecd96efb0a..eb6f993d8e 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -503,6 +503,25 @@ qemuSetupGraphicsCgroup(virDomainObjPtr vm, } =20 =20 +static int +qemuSetupVideoAccelCgroup(virDomainObjPtr vm, + virDomainVideoAccelDefPtr def) +{ + qemuDomainObjPrivatePtr priv =3D vm->privateData; + int ret; + + if (!def->rendernode || + !virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_DEVICE= S)) + return 0; + + ret =3D virCgroupAllowDevicePath(priv->cgroup, def->rendernode, + VIR_CGROUP_DEVICE_RW, false); + virDomainAuditCgroupPath(vm, priv->cgroup, "allow", def->rendernode, + "rw", ret); + return ret; +} + + static int qemuSetupBlkioCgroup(virDomainObjPtr vm) { @@ -803,6 +822,11 @@ qemuSetupDevicesCgroup(virDomainObjPtr vm) goto cleanup; } =20 + for (i =3D 0; i < vm->def->nvideos; i++) { + if (qemuSetupVideoAccelCgroup(vm, vm->def->videos[i]->accel) < 0) + goto cleanup; + } + for (i =3D 0; i < vm->def->ninputs; i++) { if (qemuSetupInputCgroup(vm, vm->def->inputs[i]) < 0) goto cleanup; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list