From nobody Thu May 2 11:18:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linux.intel.com ARC-Seal: i=1; a=rsa-sha256; t=1564620114; cv=none; d=zoho.com; s=zohoarc; b=WQMAUP1WVx2vxIH8Oa9tNYzS6Z4nbjyHeNiESi0zcBUFJDrDGY2RvKsEKyeqeEQypHPPlyWAvchGcDaR5bJQ9jjV6dSU8aZ4GcJGCk9cL0s/fb21I3hcfO1vgM+8xmBFwXLWlDVnF9qq+5+RHYQWI3B41oykAJ/H2fMfHyNGycA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564620114; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=mucQLR2Td6Lahf0rjsb3Bq7Bt/t2KvJ/VN2uk5YEH6Y=; b=oQZojCfRIctoIBv5br+TyKBnMZ5Gq/AGJttEoVEcmjlue/Kbwg2b3OMB/JVUBZ+vGV8N+671VsXg/GO/5Kc9rGqdGigTbeNgz0TrAVEpLII5FZ4QCUKZyrsJgQNGwYAwhkXEf4j2ie65jAIdTXbcucYi1SQbs7E62wi1cAkJ6M8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1564620114785332.6005264042898; Wed, 31 Jul 2019 17:41:54 -0700 (PDT) Received: from localhost ([::1]:45290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hszAE-0003NB-Pk for importer@patchew.org; Wed, 31 Jul 2019 20:41:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47491) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsz9n-0002vx-PG for qemu-devel@nongnu.org; Wed, 31 Jul 2019 20:41:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsz9k-0004Fx-Og for qemu-devel@nongnu.org; Wed, 31 Jul 2019 20:41:23 -0400 Received: from mga06.intel.com ([134.134.136.31]:27703) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hsz9k-0004Ec-HB for qemu-devel@nongnu.org; Wed, 31 Jul 2019 20:41:20 -0400 Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jul 2019 17:41:18 -0700 Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by orsmga005.jf.intel.com with ESMTP; 31 Jul 2019 17:41:17 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,332,1559545200"; d="scan'208";a="347821709" From: Wei Yang To: qemu-devel@nongnu.org Date: Thu, 1 Aug 2019 08:40:53 +0800 Message-Id: <20190801004053.7021-1-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.31 Subject: [Qemu-devel] [PATCH v2] docs/nvdimm: add example on persistent backend setup X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pagupta@redhat.com, Wei Yang , xiaoguangrong.eric@gmail.com, stefanha@redhat.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Persistent backend setup requires some knowledge about nvdimm and ndctl tool. Some users report they may struggle to gather these knowledge and have difficulty to setup it properly. Here we provide two examples for persistent backend and gives the link to ndctl. By doing so, user could try it directly and do more investigation on persistent backend setup with ndctl. Signed-off-by: Wei Yang Reviewed-by: Pankaj Gupta Reviewed-by: Stefan Hajnoczi --- v2: rephrase the doc based on Stefan Hajnoczi's suggestion --- docs/nvdimm.txt | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/docs/nvdimm.txt b/docs/nvdimm.txt index b531cacd35..362e99109e 100644 --- a/docs/nvdimm.txt +++ b/docs/nvdimm.txt @@ -171,6 +171,35 @@ guest software that this vNVDIMM device contains a reg= ion that cannot accept persistent writes. In result, for example, the guest Linux NVDIMM driver, marks such vNVDIMM device as read-only. =20 +Backend File Setup Example +-------------------------- + +Here are two examples showing how to setup these persistent backends on +linux using the tool ndctl [3]. + +A. DAX device + +Use the following command to set up /dev/dax0.0 so that the entirety of +namespace0.0 can be exposed as an emulated NVDIMM to the guest: + + ndctl create-namespace -f -e namespace0.0 -m devdax + +The /dev/dax0.0 could be used directly in "mem-path" option. + +B. DAX file + +Individual files on a DAX host file system can be exposed as emulated +NVDIMMS. First an fsdax block device is created, partitioned, and then +mounted with the "dax" mount option: + + ndctl create-namespace -f -e namespace0.0 -m fsdax + (partition /dev/pmem0 with name pmem0p1) + mount -o dax /dev/pmem0p1 /mnt + (create or copy a disk image file with qemu-img(1), cp(1), or dd(1) + in /mnt) + +Then the new file in /mnt could be used in "mem-path" option. + NVDIMM Persistence ------------------ =20 @@ -212,3 +241,5 @@ References https://www.snia.org/sites/default/files/technical_work/final/NVMProgr= ammingModel_v1.2.pdf [2] Persistent Memory Development Kit (PMDK), formerly known as NVML proje= ct, home page: http://pmem.io/pmdk/ +[3] ndctl-create-namespace - provision or reconfigure a namespace + http://pmem.io/ndctl/ndctl-create-namespace.html --=20 2.17.1