From nobody Sun Feb 8 19:56:05 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1595410862; cv=none; d=zohomail.com; s=zohoarc; b=LKOVCa/i8U5XGHMk58ZIMgzlf8RlHvdYoHkFS8qVPf5rTVHzY46hdIda01uH5pmTtkTacAl2rjtF76aCf5s3i3ropV7R/rTvYcYu2ZIR3T7xBlcpMxiaynpB63ucl31o4khclEe8z8JiRg4i/Nve+AR8apMolAXoa+CHQAknNyc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595410862; 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=NTDYsdb8VX5yZaSQX8Q9bgwCNWv2IGZ6wXNfxGbXxJ4=; b=ZvJxQVTnEaiHcvvu2YHsNbRFgIw9PWphuHvpnyv1YSvb2bZj93zl7huicpYBjCG7fCBXsWZhErcmfRSP7DuCYCMWuYr/MocOpLx+E0YQOZaQ3hAWH4TaWTknxpcwl0G77nC/wam9By+W6Z9LxQR5NZWdLiSq0NAuqmgL9Pli6tw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1595410862972601.9061865973068; Wed, 22 Jul 2020 02:41:02 -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-178-MgfmasCEOuyN3YN92NUOVw-1; Wed, 22 Jul 2020 05:40:59 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 07AED100AA22; Wed, 22 Jul 2020 09:40:53 +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 DCADF710A0; Wed, 22 Jul 2020 09:40:52 +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 ACA391806B0D; Wed, 22 Jul 2020 09:40:52 +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 06M9eiui000878 for ; Wed, 22 Jul 2020 05:40:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 28DD928559; Wed, 22 Jul 2020 09:40:44 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.195.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9B9CE1A90F for ; Wed, 22 Jul 2020 09:40:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595410861; 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=NTDYsdb8VX5yZaSQX8Q9bgwCNWv2IGZ6wXNfxGbXxJ4=; b=dZqezt7tkYAIQgIVYfAdLiTZgylPaOWWAKhCxur/BQ5K78svq20okFlOny9U3ytf5LT0w/ klgNikCllsE5XrW8YEgEuAqwhH+IFU+r7mnD38NUJRXxYmeydnJh9pQFF9bcdGD8/udbXT hg5orBjqiwRmekhxWiNYt6sNI0pE2XA= X-MC-Unique: MgfmasCEOuyN3YN92NUOVw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v1 07/34] qemuDomainNamespaceSetupHostdev: Create paths in one go Date: Wed, 22 Jul 2020 11:40:01 +0200 Message-Id: <0d1ada7c93f48451d7429a375ff38c28aa921162.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.15 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" While qemuDomainNamespaceMknodPaths() doesn't actually creates files in the namespace in one go (it forks for each path), it a few commits time it will. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain_namespace.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain_namespace.c b/src/qemu/qemu_domain_namesp= ace.c index 41451bec9f..6bd1fb30cf 100644 --- a/src/qemu/qemu_domain_namespace.c +++ b/src/qemu/qemu_domain_namespace.c @@ -1655,6 +1655,8 @@ qemuDomainNamespaceSetupHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr hostdev) { g_autofree char *path =3D NULL; + VIR_AUTOSTRINGLIST paths =3D NULL; + size_t npaths =3D 0; =20 if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT)) return 0; @@ -1662,12 +1664,16 @@ qemuDomainNamespaceSetupHostdev(virDomainObjPtr vm, if (qemuDomainGetHostdevPath(hostdev, &path, NULL) < 0) return -1; =20 - if (path && qemuDomainNamespaceMknodPath(vm, path) < 0) + if (path && virStringListAdd(&paths, path) < 0) return -1; =20 if (qemuHostdevNeedsVFIO(hostdev) && !qemuDomainNeedsVFIO(vm->def) && - qemuDomainNamespaceMknodPath(vm, QEMU_DEV_VFIO) < 0) + virStringListAdd(&paths, QEMU_DEV_VFIO) < 0) + return -1; + + npaths =3D virStringListLength((const char **) paths); + if (qemuDomainNamespaceMknodPaths(vm, (const char **) paths, npaths) <= 0) return -1; =20 return 0; --=20 2.26.2