docs/nvdimm: add description of alignment requirement of device dax
authorJingqi Liu <jingqi.liu@intel.com>
Wed, 29 Apr 2020 08:50:10 +0000 (16:50 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 26 Jun 2020 13:39:36 +0000 (09:39 -0400)
For device dax (e.g., /dev/dax0.0), the NUM of 'align=NUM' option
needs to match the alignment requirement of the device dax.
It must be larger than or equal to the 'align' of device dax.

Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Jingqi Liu <jingqi.liu@intel.com>
Message-Id: <20200429085011.63752-3-jingqi.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
docs/nvdimm.txt
exec.c

index 362e99109e7b8458fcfee4d52194f1a26e1167aa..c2c6e441b34e6141717793a82898e5f60e8daf68 100644 (file)
@@ -132,6 +132,16 @@ address to the page size (getpagesize(2)) by default. However, some
 types of backends may require an alignment different than the page
 size. In that case, QEMU v2.12.0 and later provide 'align' option to
 memory-backend-file to allow users to specify the proper alignment.
+For device dax (e.g., /dev/dax0.0), this alignment needs to match the
+alignment requirement of the device dax. The NUM of 'align=NUM' option
+must be larger than or equal to the 'align' of device dax.
+We can use one of the following commands to show the 'align' of device dax.
+
+    ndctl list -X
+    daxctl list -R
+
+In order to get the proper 'align' of device dax, you need to install
+the library 'libdaxctl'.
 
 For example, device dax require the 2 MB alignment, so we can use
 following QEMU command line options to use it (/dev/dax0.0) as the
diff --git a/exec.c b/exec.c
index c5ab59ec44316b107b08f37ddc5b2cc2e9ed77f0..21926dc9c72e919622c727395be78902188740a1 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -2379,7 +2379,7 @@ RAMBlock *qemu_ram_alloc_from_fd(ram_addr_t size, MemoryRegion *mr,
     file_align = get_file_align(fd);
     if (file_align > 0 && mr && file_align > mr->align) {
         error_setg(errp, "backing store align 0x%" PRIx64
-                   " is larger than 'align' option 0x" PRIx64,
+                   " is larger than 'align' option 0x%" PRIx64,
                    file_align, mr->align);
         return NULL;
     }