]> git.proxmox.com Git - mirror_qemu.git/blob - include/qemu/pmem.h
util/reserved-region: Add new ReservedRegion helpers
[mirror_qemu.git] / include / qemu / pmem.h
1 /*
2 * QEMU header file for libpmem.
3 *
4 * Copyright (c) 2018 Intel Corporation.
5 *
6 * Author: Haozhong Zhang <address@hidden>
7 *
8 * This work is licensed under the terms of the GNU GPL, version 2 or later.
9 * See the COPYING file in the top-level directory.
10 */
11
12 #ifndef QEMU_PMEM_H
13 #define QEMU_PMEM_H
14
15 #ifdef CONFIG_LIBPMEM
16 #include <libpmem.h>
17 #else /* !CONFIG_LIBPMEM */
18
19 static inline void *
20 pmem_memcpy_persist(void *pmemdest, const void *src, size_t len)
21 {
22 /* If 'pmem' option is 'on', we should always have libpmem support,
23 or qemu will report a error and exit, never come here. */
24 g_assert_not_reached();
25 return NULL;
26 }
27
28 static inline void
29 pmem_persist(const void *addr, size_t len)
30 {
31 g_assert_not_reached();
32 }
33
34 #endif /* CONFIG_LIBPMEM */
35
36 #endif /* QEMU_PMEM_H */