From nobody Sun Feb 8 22:43:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1595411057; cv=none; d=zohomail.com; s=zohoarc; b=AIjVTHkm2ohFsVZRiTI6caWwQCnZdpRS4LVpbQkcR9V0OMBEKMPg6V1p1JCbdSGIsC7iDc5wXyyJIk4nVzQUfKqksM5d3Bzyimgm1670vayhaYqmJzxWloAqTLG7APkJ65gMdjrm2HsNZomw0JJbmFuSvRstgjXEDR1IpsrGAnQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595411057; h=Content-Type:Content-Transfer-Encoding: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=xTvXu85woPqnOyfO+7EIw4/+wLEW4mwfwCIE5HHA4yg=; b=jhVxV7nc2sWXk/witxCh4cq/51OGbnelS8utmUr7+JeS2w/ltLeU3n1zUEeIk1vN4J+8W5Z5z1pMDiXg6uf/lm6yca7CRP36Qfl9WY8DJS2FQ0Ij4BAoyBQjEkSKQrbYVxT6LaRUQfhbpho0RwuYJYPc+1oum+CewMpNx4xw7DA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1595411057176372.7411596023642; Wed, 22 Jul 2020 02:44:17 -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-322-DRiqy9aJOE-XoV9qqGjIBA-1; Wed, 22 Jul 2020 05:44:13 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id B6F93100CCC7; Wed, 22 Jul 2020 09:44:06 +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 943C96FEFE; Wed, 22 Jul 2020 09:44:06 +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 62313730F7; Wed, 22 Jul 2020 09:44:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06M9f4kh001029 for ; Wed, 22 Jul 2020 05:41:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id 34AD22B6DB; Wed, 22 Jul 2020 09:41:04 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.195.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id A69822B5BF for ; Wed, 22 Jul 2020 09:41:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595411055; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=xTvXu85woPqnOyfO+7EIw4/+wLEW4mwfwCIE5HHA4yg=; b=KxEj/6eOU6qYcw7knSkRvWk1mwCLUiGSocLO5uj3wxIqsxrTbE/sftrrrgpF0uM9jds42k UJ5nwIvua7AWj8zZ9ladVflkTWIg6S7iz/uzbg039b6KHrNuw1pnfdn5qJBWkC3h1++ASw UcIUC1IjYN3ml7qj0WHpEe0ODEc3IzA= X-MC-Unique: DRiqy9aJOE-XoV9qqGjIBA-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v1 22/34] qemuDomainBuildNamespace: Populate graphics from daemon's namespace Date: Wed, 22 Jul 2020 11:40:16 +0200 Message-Id: <11f939f231915325db4b5d36c26b60e2ce1e9b18.1595410402.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com 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.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" As mentioned in one of previous commits, populating domain's namespace from pre-exec() hook is dangerous. This commit moves population of the namespace with domain graphics (render node) into daemon's namespace. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain_namespace.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_domain_namespace.c b/src/qemu/qemu_domain_namesp= ace.c index 138dc63489..8a77c067c8 100644 --- a/src/qemu/qemu_domain_namespace.c +++ b/src/qemu/qemu_domain_namespace.c @@ -701,27 +701,27 @@ qemuDomainSetupAllTPMs(virDomainObjPtr vm, =20 static int qemuDomainSetupGraphics(virDomainGraphicsDefPtr gfx, - const struct qemuDomainCreateDeviceData *data) + char ***paths) { const char *rendernode =3D virDomainGraphicsGetRenderNode(gfx); =20 if (!rendernode) return 0; =20 - return qemuDomainCreateDevice(rendernode, data, false); + return virStringListAdd(paths, rendernode); } =20 =20 static int qemuDomainSetupAllGraphics(virDomainObjPtr vm, - const struct qemuDomainCreateDeviceData *data) + char ***paths) { size_t i; =20 VIR_DEBUG("Setting up graphics"); for (i =3D 0; i < vm->def->ngraphics; i++) { if (qemuDomainSetupGraphics(vm->def->graphics[i], - data) < 0) + paths) < 0) return -1; } =20 @@ -882,6 +882,9 @@ qemuDomainBuildNamespace(virQEMUDriverConfigPtr cfg, if (qemuDomainSetupAllTPMs(vm, &paths) < 0) return -1; =20 + if (qemuDomainSetupAllGraphics(vm, &paths) < 0) + return -1; + if (qemuDomainNamespaceMknodPaths(vm, (const char **) paths) < 0) return -1; =20 @@ -933,9 +936,6 @@ qemuDomainUnshareNamespace(virQEMUDriverConfigPtr cfg, if (qemuDomainSetupDev(mgr, vm, devPath) < 0) goto cleanup; =20 - if (qemuDomainSetupAllGraphics(vm, &data) < 0) - goto cleanup; - if (qemuDomainSetupAllInputs(vm, &data) < 0) goto cleanup; =20 --=20 2.26.2