@@ -17,6 +17,7 @@
#else /* !CONFIG_LIBPMEM */
void *pmem_memcpy_persist(void *pmemdest, const void *src, size_t len);
+void pmem_persist(const void *addr, size_t len);
#endif /* CONFIG_LIBPMEM */
@@ -33,6 +33,7 @@
#include "qemu/bitops.h"
#include "qemu/bitmap.h"
#include "qemu/main-loop.h"
+#include "qemu/pmem.h"
#include "xbzrle.h"
#include "ram.h"
#include "migration.h"
@@ -3541,6 +3542,13 @@ static int ram_load_setup(QEMUFile *f, void *opaque)
static int ram_load_cleanup(void *opaque)
{
RAMBlock *rb;
+
+ RAMBLOCK_FOREACH_MIGRATABLE(rb) {
+ if (ramblock_is_pmem(rb)) {
+ pmem_persist(rb->host, rb->used_length);
+ }
+ }
+
xbzrle_load_cleanup();
compress_threads_load_cleanup();
@@ -3896,7 +3904,7 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
static bool ram_has_postcopy(void *opaque)
{
RAMBlock *rb;
- RAMBLOCK_FOREACH(rb) {
+ RAMBLOCK_FOREACH_MIGRATABLE(rb) {
if (ramblock_is_pmem(rb)) {
info_report("Block: %s, host: %p is a nvdimm memory, postcopy"
"is not supported now!", rb->idstr, rb->host);
@@ -17,3 +17,7 @@ void *pmem_memcpy_persist(void *pmemdest, const void *src, size_t len)
{
return memcpy(pmemdest, src, len);
}
+
+void pmem_persist(const void *addr, size_t len)
+{
+}