All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hostmem-file: warn when memory-backend-file, share=on and in incoming migration
@ 2019-04-08  2:19 ` Catherine Ho
  0 siblings, 0 replies; 22+ messages in thread
From: Catherine Ho @ 2019-04-08  2:19 UTC (permalink / raw)
  To: Paolo Bonzini, Richard Henderson, Dr. David Alan Gilbert
  Cc: Markus Armbruster, Juan Quintela, qemu-devel, Peter Xu, Catherine Ho

Currently it is not forbidden to use "-object memory-backend-file,share=on"
and together with "-incoming". But after incoming migration is finished,
the memory-backend-file will be definitely written if share=on. So the
memory-backend-file can only be used once, but failed in the 2nd time
incoming.

Thus it gives a warning and the users can run the qemu if they really
want to do it.

Signed-off-by: Catherine Ho <catherine.hecx@gmail.com>
---
 backends/hostmem-file.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c
index 37ac6445d2..59429ee0b4 100644
--- a/backends/hostmem-file.c
+++ b/backends/hostmem-file.c
@@ -16,6 +16,7 @@
 #include "sysemu/hostmem.h"
 #include "sysemu/sysemu.h"
 #include "qom/object_interfaces.h"
+#include "migration/migration.h"
 
 /* hostmem-file.c */
 /**
@@ -79,6 +80,16 @@ file_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)
         }
     }
 
+    /*
+     * In ignore shared case, if share=on for host memory backend file,
+     * the ram might be written after incoming process is finished. Thus
+     * the memory backend can't be reused for 2nd/3rd... incoming
+     */
+    if (backend->share && migrate_ignore_shared()
+                       && runstate_check(RUN_STATE_INMIGRATE))
+        warn_report("share=on for memory backend file might be "
+                        "conflicted with incoming in ignore shared case");
+
     backend->force_prealloc = mem_prealloc;
     name = host_memory_backend_get_name(backend);
     memory_region_init_ram_from_file(&backend->mr, OBJECT(backend),
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2019-04-11  1:26 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-08  2:19 [Qemu-devel] [PATCH] hostmem-file: warn when memory-backend-file, share=on and in incoming migration Catherine Ho
2019-04-08  2:19 ` Catherine Ho
2019-04-08  3:25 ` Peter Xu
2019-04-08  3:25   ` Peter Xu
2019-04-08  6:15   ` Catherine Ho
2019-04-08  6:15     ` Catherine Ho
2019-04-08  7:04     ` Peter Xu
2019-04-08  7:04       ` Peter Xu
2019-04-08  8:43 ` [Qemu-devel] [PATCH v2] " Catherine Ho
2019-04-08  8:43   ` Catherine Ho
2019-04-08 10:35 ` [Qemu-devel] [PATCH] " Igor Mammedov
2019-04-08 10:35   ` Igor Mammedov
2019-04-09  2:21   ` Catherine Ho
2019-04-09  2:21     ` Catherine Ho
2019-04-10 14:59     ` Dr. David Alan Gilbert
2019-04-10 14:59       ` Dr. David Alan Gilbert
2019-04-10 15:36       ` Catherine Ho
2019-04-10 15:36         ` Catherine Ho
2019-04-10 16:57         ` Dr. David Alan Gilbert
2019-04-10 16:57           ` Dr. David Alan Gilbert
2019-04-11  1:25           ` Catherine Ho
2019-04-11  1:25             ` Catherine Ho

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.