]> git.proxmox.com Git - mirror_qemu.git/blobdiff - include/qemu/osdep.h
hostmem-file: reject invalid pmem file sizes
[mirror_qemu.git] / include / qemu / osdep.h
index 840af09cb0e4683bb57f7a8e8595d05836df67f4..303d315c5d4f4232ffbbea742aae6bc78a4dba7a 100644 (file)
@@ -570,6 +570,19 @@ void qemu_set_tty_echo(int fd, bool echo);
 void os_mem_prealloc(int fd, char *area, size_t sz, int smp_cpus,
                      Error **errp);
 
+/**
+ * qemu_get_pmem_size:
+ * @filename: path to a pmem file
+ * @errp: pointer to a NULL-initialized error object
+ *
+ * Determine the size of a persistent memory file.  Besides supporting files on
+ * DAX file systems, this function also supports Linux devdax character
+ * devices.
+ *
+ * Returns: the size or 0 on failure
+ */
+uint64_t qemu_get_pmem_size(const char *filename, Error **errp);
+
 /**
  * qemu_get_pid_name:
  * @pid: pid of a process