qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] migrate: Migration aborts abruptly for machine "none"
@ 2017-01-26  9:16 Ashijeet Acharya
  2017-01-26 11:25 ` Kashyap Chamarthy
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Ashijeet Acharya @ 2017-01-26  9:16 UTC (permalink / raw)
  To: thuth; +Cc: quintela, dgilbert, berrange, qemu-devel, Ashijeet Acharya

Migration of a "none" machine with no RAM crashes abruptly as
bitmap_new() fails and thus aborts. Instead, place a check for
last_ram_offset() being '0' at the start of ram_save_setup() and
error out with a meaningful error message.

Signed-off-by: Ashijeet Acharya <ashijeetacharya@gmail.com>
---
 migration/ram.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/migration/ram.c b/migration/ram.c
index ef8fadf..bf05d69 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1947,6 +1947,11 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
 {
     RAMBlock *block;
 
+    if (last_ram_offset() == 0) {
+        error_report("Failed to migrate: No RAM available!");
+        return -1;
+    }
+
     /* migration has already setup the bitmap, reuse it. */
     if (!migration_in_colo_state()) {
         if (ram_save_init_globals() < 0) {
-- 
2.6.2

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

end of thread, other threads:[~2017-02-01 17:53 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-26  9:16 [Qemu-devel] [PATCH] migrate: Migration aborts abruptly for machine "none" Ashijeet Acharya
2017-01-26 11:25 ` Kashyap Chamarthy
2017-01-26 19:41 ` Dr. David Alan Gilbert
2017-01-27  9:37 ` Daniel P. Berrange
2017-01-27  9:46   ` Dr. David Alan Gilbert
2017-01-27  9:57     ` Daniel P. Berrange
2017-01-27  9:52   ` Ashijeet Acharya
2017-01-27  9:57     ` Daniel P. Berrange
2017-01-28 18:41 ` Greg Kurz
2017-01-28 19:36   ` Ashijeet Acharya
2017-01-29 13:03     ` Greg Kurz
2017-01-29 13:19       ` Ashijeet Acharya
2017-01-30 20:48         ` Paolo Bonzini
2017-02-01 17:53           ` Ashijeet Acharya

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).