diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2009-11-30 18:21:21 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-12-03 10:48:53 -0600 |
commit | 9a743e5ba32f7a620baa0b3d3808e88d2433e861 (patch) | |
tree | 0b123836b66b7051a0dbe39eb7fceaf8592d33a6 /vl.c | |
parent | 4b640365c79c970d150beb940559b78709a042cb (diff) | |
download | qemu-9a743e5ba32f7a620baa0b3d3808e88d2433e861.zip qemu-9a743e5ba32f7a620baa0b3d3808e88d2433e861.tar.gz qemu-9a743e5ba32f7a620baa0b3d3808e88d2433e861.tar.bz2 |
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 <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; |