| 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 | } |
| 26 | |
| 27 | static inline void |
| 28 | pmem_persist(const void *addr, size_t len) |
| 29 | { |
| 30 | g_assert_not_reached(); |
| 31 | } |
| 32 | |
| 33 | #endif /* CONFIG_LIBPMEM */ |
| 34 | |
| 35 | #endif /* QEMU_PMEM_H */ |