From: Jan Kiszka Date: Mon, 30 Nov 2009 17:21:21 +0000 (+0100) Subject: ram migration: Stop loading on error X-Git-Tag: qemu-xen-4.3.0-rc1~6488 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=9a743e5ba32f7a620baa0b3d3808e88d2433e861;p=qemu-upstream-4.5-testing.git ram migration: Stop loading on error Besides catching real errors, this also allows to interrrupt the qemu process during restore. Signed-off-by: Jan Kiszka Signed-off-by: Anthony Liguori --- diff --git a/vl.c b/vl.c index ba5bd3d80..62427b8f9 100644 --- a/vl.c +++ b/vl.c @@ -3016,8 +3016,12 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id) madvise(qemu_get_ram_ptr(addr), TARGET_PAGE_SIZE, MADV_DONTNEED); } #endif - } else if (flags & RAM_SAVE_FLAG_PAGE) + } else if (flags & RAM_SAVE_FLAG_PAGE) { qemu_get_buffer(f, qemu_get_ram_ptr(addr), TARGET_PAGE_SIZE); + } + if (qemu_file_has_error(f)) { + return -EIO; + } } while (!(flags & RAM_SAVE_FLAG_EOS)); return 0;