From nobody Mon Sep 16 20:01:20 2024 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=1694440371; cv=none; d=zohomail.com; s=zohoarc; b=EEOlduf9xqln2P9oG0dRPsxrdJc9INHliHKXjJI5dsqHGFr4KQj3m+N9zLd1loEwnKOG/mZExIsr9s6ysaWJ5GmOV3ck/qUyZw5IiWLn4w9qIrf3LDuRwGW/kB7zdg00U8Te8sHnofa4v5WPFMo8m28EDWtnuJ2IbliyXDC7yII= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694440371; 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=8YFv3/655hOJCDA2NDqw1E3kMd+6rrozVh/l0lvGFdI=; b=hm78vzBWjuaObsL6t2WPu/9xGM7n9+/g1nRA1sk5nTmwFfveBdVLd95dQAo4ve5XHUOE5MzVXMCgWrsQ9jrVE83B28EPdwefa033BxtR9UE5c0Ijnr9OIpldMJTTvzheJdTD4UPcAaTwROCrnVCCaL9L9O+ZcBYrDVrngD32lW4= 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 1694440371081664.3034666174975; Mon, 11 Sep 2023 06:52:51 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-260-4WJ6QRRJNeSXfcCivsrqPA-1; Mon, 11 Sep 2023 09:52:36 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DC4F629DD9A4; Mon, 11 Sep 2023 13:52:32 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA23D21CAC8E; Mon, 11 Sep 2023 13:52:32 +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 50F321946A49; Mon, 11 Sep 2023 13:52:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 752FF19465B2 for ; Mon, 11 Sep 2023 13:52:31 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6661110005D2; Mon, 11 Sep 2023 13:52:31 +0000 (UTC) Received: from fedora.. (unknown [10.43.2.118]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D9EE10EE6C9 for ; Mon, 11 Sep 2023 13:52:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694440370; 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=8YFv3/655hOJCDA2NDqw1E3kMd+6rrozVh/l0lvGFdI=; b=J9LxwWYIrdW8SUxCEH2l519vcG1UaepzHZzkcqBESZhV/WSdlgCA4lEAEIJqHdeMYAsq2t tZMSm7+1cutPzEYLb9r8aPkG5UjbmDOCbCMxSb41rodG19bBVJD6cZyVA3A5m0Vy0V3CG6 LlczWSPkTH7adkWXCYWUWeSIGv0Txrc= X-MC-Unique: 4WJ6QRRJNeSXfcCivsrqPA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCHv1 5/8] qemu: format uid/gid map for virtiofs Date: Mon, 11 Sep 2023 15:51:25 +0200 Message-ID: <9023fd862b7dd7b5f38001beef20f932a7d88b3d.1694440288.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1694440401992100001 Pass the ID map to virtiofsd. https://bugzilla.redhat.com/show_bug.cgi?id=3D2034630 https://gitlab.com/libvirt/libvirt/-/issues/535 Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_virtiofs.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/qemu/qemu_virtiofs.c b/src/qemu/qemu_virtiofs.c index 230f85c291..94c8b4711e 100644 --- a/src/qemu/qemu_virtiofs.c +++ b/src/qemu/qemu_virtiofs.c @@ -169,6 +169,19 @@ qemuVirtioFSBuildCommandLine(virQEMUDriverConfig *cfg, if (cfg->virtiofsdDebug) virCommandAddArg(cmd, "-d"); =20 + if (fs->idmap.nuidmap > 0) { + virCommandAddArgFormat(cmd, "--uid-map=3D:%u:%u:%u:", + fs->idmap.uidmap[0].start, + fs->idmap.uidmap[0].target, + fs->idmap.uidmap[0].count); + } + if (fs->idmap.ngidmap > 0) { + virCommandAddArgFormat(cmd, "--gid-map=3D:%u:%u:%u:", + fs->idmap.gidmap[0].start, + fs->idmap.gidmap[0].target, + fs->idmap.gidmap[0].count); + } + return g_steal_pointer(&cmd); } =20 --=20 2.41.0