From nobody Tue Apr 23 18:37:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1631199833; cv=none; d=zohomail.com; s=zohoarc; b=Ggm4AAgVDKMFbMQcCYLOpI+MZZSRFS71vGJ7vV0LL1ydJ2lKkgXnt4FOorw/bQSNYEwzgwnHBpRyc+tGX08NvNRcWpJ78U9M55Aqvbk0cpCtbPWDjZZpx7clNzLbMIYgB9/naxh+Yq3ys3AHAmuLwlpKrS6lNBHnxJRulQSZ1b4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631199833; 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; bh=Dc7HpgZG58uPbvV2d+e0LHFSQHkwAJ73A3o14zLeltQ=; b=Ps4tB/sE7ehqCzNuUSzdui21kOcWOyhM+whB/mEhjvGW7pnuBuiqUbXxnrT8ba5n944E/rtG7pQoNFeqMugcBtmo7VUIIOjem9lunlf7ThWY/hya+qFGZDU78K01v9N4C4x9FSZTsRdRzzPrHHKfto8l3MN6LwFmk/WFb+xs9q8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1631199833366783.2630393072192; Thu, 9 Sep 2021 08:03:53 -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-541-orVU1dswNpSvOD5Nz9FSxQ-1; Thu, 09 Sep 2021 11:03:50 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C144489BBC9; Thu, 9 Sep 2021 15:03:42 +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 7C5B07C155; Thu, 9 Sep 2021 15:03:41 +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 8E9E81800FE4; Thu, 9 Sep 2021 15:03:40 +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 189Ewk0K002377 for ; Thu, 9 Sep 2021 10:58:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0EC705DF26; Thu, 9 Sep 2021 14:58:46 +0000 (UTC) Received: from localhost (unknown [10.39.192.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id E8CB15D9C6; Thu, 9 Sep 2021 14:58:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631199832; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=Dc7HpgZG58uPbvV2d+e0LHFSQHkwAJ73A3o14zLeltQ=; b=VNIW5VJJpeBTAcuIva8dBMSOlA9L4cksB/m/KFt+yuZDbPZYOmn7SXw6pPFwPeE/DYM0Dz t0lgLT7oh6e5B4UkYr05s1incNBYTJ7Wp/h9WBhHEF+vm8in4AoI5y7SIdSMQRBtXbBnOb nr+/AbwYjhMdXqPABJiD6oBN6l23iOQ= X-MC-Unique: orVU1dswNpSvOD5Nz9FSxQ-1 From: Stefan Hajnoczi To: libvir-list@redhat.com Subject: [libvirt PATCH 1/2] docs: virtiofs: move legacy docs to the bottom Date: Thu, 9 Sep 2021 15:58:28 +0100 Message-Id: <20210909145829.970242-2-stefanha@redhat.com> In-Reply-To: <20210909145829.970242-1-stefanha@redhat.com> References: <20210909145829.970242-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: pkrempa@redhat.com, jtomko@redhat.com, "Dr. David Alan Gilbert" , Stefan Hajnoczi 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.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631199834162100001 Content-Type: text/plain; charset="utf-8" A number of legacy issues make the virtiofs kbase article hard to understand. Most users don't need to configure NUMA or a memory backend other than memfd. Move that information to the bottom of the article so the recommended syntax is most prominent. Suggested-by: Richard W.M. Jones Signed-off-by: Stefan Hajnoczi Reviewed-by: J=C3=A1n Tomko Reviewed-by: Richard W.M. Jones --- docs/kbase/virtiofs.rst | 171 +++++++++++++++++++++------------------- 1 file changed, 91 insertions(+), 80 deletions(-) diff --git a/docs/kbase/virtiofs.rst b/docs/kbase/virtiofs.rst index 6ba7299a72..75e740bf96 100644 --- a/docs/kbase/virtiofs.rst +++ b/docs/kbase/virtiofs.rst @@ -13,8 +13,82 @@ is designed to offer local file system semantics and per= formance. =20 See https://virtio-fs.gitlab.io/ =20 -Host setup -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +Sharing a host directory with a guest +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +#. Add the following domain XML elements to share the host directory `/pat= h` + with the guest + + :: + + + ... + + + + + ... + + ... + + + + + + ... + + + + Don't forget the ```` elements. They are necessary for t= he + vhost-user connection with the ``virtiofsd`` daemon. + + Note that despite its name, the ``target dir`` is an arbitrary string c= alled + a mount tag that is used inside the guest to identify the shared file s= ystem + to be mounted. It does not have to correspond to the desired mount poin= t in the + guest. + +#. Boot the guest and mount the filesystem + + :: + + guest# mount -t virtiofs mount_tag /mnt/mount/path + + Note: this requires virtiofs support in the guest kernel (Linux v5.4 or= later) + +Optional parameters +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +More optional elements can be specified + +:: + + + + + + + +Externally-launched virtiofsd +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D + +Libvirtd can also connect the ``vhost-user-fs`` device to a ``virtiofsd`` +daemon launched outside of libvirtd. In that case socket permissions, +the mount tag and all the virtiofsd options are out of libvirtd's +control and need to be set by the application running virtiofsd. + +:: + + + + + + + +Other options for vhost-user memory setup +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +The following information is necessary if you are using older versions of = QEMU +and libvirt or have special memory backend requirements. =20 Almost all virtio devices (all that use virtqueues) require access to at least certain portions of guest RAM (possibly policed by DMA). In @@ -29,34 +103,31 @@ NUMA. As of QEMU 5.0.0 and libvirt 6.9.0, it is possib= le to specify the memory backend without NUMA (using the so called memobject interface). =20 -One of the following: +#. Set up the memory backend =20 -* Use memfd memory + * Use memfd memory =20 - No host setup is required when using the Linux memfd memory backend. + No host setup is required when using the Linux memfd memory backend. =20 -* Use file-backed memory + * Use file-backed memory =20 - Configure the directory where the files backing the memory will be stored - with the ``memory_backing_dir`` option in ``/etc/libvirt/qemu.conf`` + Configure the directory where the files backing the memory will be st= ored + with the ``memory_backing_dir`` option in ``/etc/libvirt/qemu.conf`` =20 - :: + :: =20 - # This directory is used for memoryBacking source if configured as fil= e. - # NOTE: big files will be stored here - memory_backing_dir =3D "/dev/shm/" + # This directory is used for memoryBacking source if configured as = file. + # NOTE: big files will be stored here + memory_backing_dir =3D "/dev/shm/" =20 -* Use hugepage-backed memory + * Use hugepage-backed memory =20 - Make sure there are enough huge pages allocated for the requested guest = memory. - For example, for one guest with 2 GiB of RAM backed by 2 MiB hugepages: + Make sure there are enough huge pages allocated for the requested gue= st memory. + For example, for one guest with 2 GiB of RAM backed by 2 MiB hugepage= s: =20 - :: + :: =20 - # virsh allocpages 2M 1024 - -Guest setup -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + # virsh allocpages 2M 1024 =20 #. Specify the NUMA topology (this step is only required for the NUMA case) =20 @@ -122,63 +193,3 @@ Guest setup ... - -#. Add the ``vhost-user-fs`` QEMU device via the ``filesystem`` element - - :: - - - ... - - ... - - - - - - ... - - - - Note that despite its name, the ``target dir`` is actually a mount tag = and does - not have to correspond to the desired mount point in the guest. - - So far, ``passthrough`` is the only supported access mode and it requir= es - running the ``virtiofsd`` daemon as root. - -#. Boot the guest and mount the filesystem - - :: - - guest# mount -t virtiofs mount_tag /mnt/mount/path - - Note: this requires virtiofs support in the guest kernel (Linux v5.4 or= later) - -Optional parameters -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D - -More optional elements can be specified - -:: - - - - - - - -Externally-launched virtiofsd -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D - -Libvirtd can also connect the ``vhost-user-fs`` device to a ``virtiofsd`` -daemon launched outside of libvirtd. In that case socket permissions, -the mount tag and all the virtiofsd options are out of libvirtd's -control and need to be set by the application running virtiofsd. - -:: - - - - - - --=20 2.31.1 From nobody Tue Apr 23 18:37:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1631199859; cv=none; d=zohomail.com; s=zohoarc; b=NN976s6La2qP2OAYawTrdzu3TL+ww6oqcnu6cqniwYbzb4WMXId6B2UOpNIIEMnnzknY/zUaz1ExmL5yfYpMs7mEjdmHpeVz3Vn40L02zM2B8uWkZPCqjZ4813Xk/6WZACbjDWPZ6a/+aaMfcl5UWCuWc1ywsrjD3iL91Fl6Ieo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631199859; 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; bh=MtZjXQvWVSCkgX4zONSVs/3qyrmmew+49rKcFx3Euxg=; b=NdFkq2DF0BzmitrYjKG3K4F5HDU39vh8CdovN/9S4kWcnKbtZvw8fQSvUkwaLim3XOt46sFpBwYLmLAs7aQAth1Q9+5MY+uRslPf7X71FX2MIYx5gB2K7b3TBC7IJffkNhkwZEE5gTiVfFP+H2Yj1Tn6IUajx4Pu2xyWirFEcRw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1631199859312813.0627226648373; Thu, 9 Sep 2021 08:04:19 -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-331-GReG8j33MbmuBdhmfpEi3Q-1; Thu, 09 Sep 2021 11:04:16 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5CFB983DBC9; Thu, 9 Sep 2021 15:03:48 +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 D7EBA7AB4D; Thu, 9 Sep 2021 15:03:47 +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 079EE4E58F; Thu, 9 Sep 2021 15:03:47 +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 189EwlX3002390 for ; Thu, 9 Sep 2021 10:58:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id 970855DEB8; Thu, 9 Sep 2021 14:58:47 +0000 (UTC) Received: from localhost (unknown [10.39.192.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 43F5B5D9C6; Thu, 9 Sep 2021 14:58:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631199858; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=MtZjXQvWVSCkgX4zONSVs/3qyrmmew+49rKcFx3Euxg=; b=IuiDZo/Sog/aocX8SWbhlZcuL1/DYDvpTJBsRnPFlSKBHt/E2B0diKX+6ozuGh104v4mBi GjdRLUolHt0dybn2M6dvxz8wYLe0Mk0xPfUB/T0dU+TREOfooC7fIbXysZtWJYFUbi+J+q sta7E9nD6UCf8RC8lgtHZmSQawo6wZA= X-MC-Unique: GReG8j33MbmuBdhmfpEi3Q-1 From: Stefan Hajnoczi To: libvir-list@redhat.com Subject: [libvirt PATCH 2/2] docs: virtiofs: use the preferred virtiofs spelling Date: Thu, 9 Sep 2021 15:58:29 +0100 Message-Id: <20210909145829.970242-3-stefanha@redhat.com> In-Reply-To: <20210909145829.970242-1-stefanha@redhat.com> References: <20210909145829.970242-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: pkrempa@redhat.com, jtomko@redhat.com, "Dr. David Alan Gilbert" , Stefan Hajnoczi 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.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631199859989100001 Content-Type: text/plain; charset="utf-8" The virtiofs project started off using "virtio-fs" but later switched to the "virtiofs" spelling because it matches the spelling of the mount -t virtiofs command-line. Update the kbase article with the new spelling so it matches the virtiofs website. Signed-off-by: Stefan Hajnoczi Reviewed-by: J=C3=A1n Tomko --- docs/kbase/virtiofs.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/kbase/virtiofs.rst b/docs/kbase/virtiofs.rst index 75e740bf96..d728a1358c 100644 --- a/docs/kbase/virtiofs.rst +++ b/docs/kbase/virtiofs.rst @@ -1,13 +1,13 @@ -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D -Sharing files with Virtio-FS -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D +Sharing files with Virtiofs +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =20 .. contents:: =20 -Virtio-FS -=3D=3D=3D=3D=3D=3D=3D=3D=3D +Virtiofs +=3D=3D=3D=3D=3D=3D=3D=3D =20 -Virtio-FS is a shared file system that lets virtual machines access +Virtiofs is a shared file system that lets virtual machines access a directory tree on the host. Unlike existing approaches, it is designed to offer local file system semantics and performance. =20 --=20 2.31.1