From nobody Tue Feb 10 07:21:21 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=1559730808; cv=none; d=zoho.com; s=zohoarc; b=BVSeOVeRZXs3OWNsT49b3geQcF/QfrHf05FeYlYdgEHb/2EV7X+n+oqO/Y416xHE6t8KNzfbO9vYHIXRYj+CdOMuyXc+bQWkB9px7CIpe5aMsxV8L0cFmrno8SuLHyrsZWJW86igsH7YnnXsXb6ponTYeaRiiXTZ9dfQRuvkLk8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559730808; 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=V8tZ6+9GePKOgO9DR5WPxAKDvJ45BbcaYtLu+zju8Gc=; b=Bsnf1YsI8Z37RB4yPXcqqbXWuipMI4GVfVtjpysK8JmLoecnxZM9Snq7Mt+otGkNQiiSp4hWyPXsVQWTxRaHU2UvlZtp2Vrhi/a7fDWOPX+PfSEYUG2Z45KBjt11eblzghLDqycyiumreWqou5xKRM0SFtwkICZvpvVyExFzeQg= 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 1559730808014786.669402098773; Wed, 5 Jun 2019 03:33:28 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 47D5FC1EB1FC; Wed, 5 Jun 2019 10:33:26 +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 21B2D6198D; Wed, 5 Jun 2019 10:33:26 +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 D829D1806B16; Wed, 5 Jun 2019 10:33:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x55AW5lw020134 for ; Wed, 5 Jun 2019 06:32:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6713360C91; Wed, 5 Jun 2019 10:32:05 +0000 (UTC) Received: from localhost (ovpn-112-54.ams2.redhat.com [10.36.112.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id 819FD60CD6; Wed, 5 Jun 2019 10:31:59 +0000 (UTC) From: marcandre.lureau@redhat.com To: libvir-list@redhat.com Date: Wed, 5 Jun 2019 12:31:05 +0200 Message-Id: <20190605103117.19047-8-marcandre.lureau@redhat.com> In-Reply-To: <20190605103117.19047-1-marcandre.lureau@redhat.com> References: <20190605103117.19047-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [libvirt] [PATCH 07/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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 05 Jun 2019 10:33:26 +0000 (UTC) From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- 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 ca76c4fdfa..1627b5ef5d 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -504,6 +504,25 @@ qemuSetupGraphicsCgroup(virDomainObjPtr vm, } =20 =20 +static int +qemuSetupVideoAccelCgroup(virDomainObjPtr vm, + const 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) { @@ -804,6 +823,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.22.0.rc2.384.g1a9a72ea1d -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list