qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: qemu-devel@nongnu.org, Liran Schour <lirans@il.ibm.com>,
	Pierre Riteau <pierre.riteau@irisa.fr>
Subject: [Qemu-devel] [PATCH 16/23] ram migration: Stop loading on error
Date: Mon, 30 Nov 2009 18:21:21 +0100	[thread overview]
Message-ID: <20091130172121.22889.19699.stgit@mchn012c.ww002.siemens.net> (raw)
In-Reply-To: <20091130172119.22889.28114.stgit@mchn012c.ww002.siemens.net>

Besides catching real errors, this also allows to interrrupt the qemu
process during restore.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

 vl.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/vl.c b/vl.c
index ee43808..64426aa 100644
--- a/vl.c
+++ b/vl.c
@@ -3017,8 +3017,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;

  parent reply	other threads:[~2009-11-30 17:28 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-30 17:21 [Qemu-devel] [PATCH 00/23] block migration: Fixes, cleanups and speedups Jan Kiszka
2009-11-30 17:21 ` [Qemu-devel] [PATCH 03/23] block migration: Fix coding style and whitespaces Jan Kiszka
2009-11-30 17:21 ` [Qemu-devel] [PATCH 02/23] migration: Catch multiple start commands Jan Kiszka
2009-11-30 17:21 ` [Qemu-devel] [PATCH 04/23] block migration: Rework constants API Jan Kiszka
2009-11-30 17:21 ` [Qemu-devel] [PATCH 01/23] migration: Fix use of file after release Jan Kiszka
2009-11-30 17:21 ` [Qemu-devel] [PATCH 11/23] block migration: Initialize remaining BlkMigState fields Jan Kiszka
2009-11-30 17:21 ` [Qemu-devel] [PATCH 12/23] block migration: Clean up use of total_sectors Jan Kiszka
2009-11-30 17:21 ` [Qemu-devel] [PATCH 08/23] block migration: Drop dead code Jan Kiszka
2009-11-30 17:21 ` [Qemu-devel] [PATCH 07/23] block migration: Avoid indirection of block_mig_state Jan Kiszka
2009-11-30 17:21 ` [Qemu-devel] [PATCH 10/23] block migration: Switch device and block lists to QSIMPLEQ Jan Kiszka
2009-11-30 17:21 ` [Qemu-devel] [PATCH 05/23] block migration: Cleanup dirty tracking code Jan Kiszka
2009-11-30 17:21 ` [Qemu-devel] [PATCH 06/23] block migration: Avoid large stack buffer Jan Kiszka
2009-11-30 17:21 ` [Qemu-devel] [PATCH 09/23] Import a simple queue implementation from NetBSD Jan Kiszka
2009-11-30 17:21 ` [Qemu-devel] [PATCH 13/23] block migration: Consolidate mig_read_device_bulk into mig_save_device_bulk Jan Kiszka
2009-11-30 17:21 ` [Qemu-devel] [PATCH 17/23] live migration: Allow cleanup after cancellation or error Jan Kiszka
2009-11-30 17:21 ` [Qemu-devel] [PATCH 19/23] live migration: Propagate output monitor to callback handler Jan Kiszka
2009-11-30 17:21 ` [Qemu-devel] [PATCH 15/23] block migration: Add error handling/propagation Jan Kiszka
2009-11-30 17:21 ` [Qemu-devel] [PATCH 20/23] block migration: Fix outgoing progress output Jan Kiszka
2009-11-30 17:21 ` Jan Kiszka [this message]
2009-11-30 17:21 ` [Qemu-devel] [PATCH 22/23] block migration: Add support for restore progress reporting Jan Kiszka
2009-12-01 14:20   ` [Qemu-devel] [PATCH v2 " Jan Kiszka
2009-12-01 17:01     ` [Qemu-devel] " Pierre Riteau
2009-12-01 17:17       ` Jan Kiszka
2009-11-30 17:21 ` [Qemu-devel] [PATCH 21/23] block migration: Report progress also via info migration Jan Kiszka
2009-11-30 17:21 ` [Qemu-devel] [PATCH 18/23] block migration: Report overall migration progress Jan Kiszka
2009-11-30 17:21 ` [Qemu-devel] [PATCH 14/23] block migration: Consolidate block transmission Jan Kiszka
2009-11-30 17:21 ` [Qemu-devel] [PATCH 23/23] block migration: Increase dirty chunk size to 1M Jan Kiszka
2009-11-30 18:34 ` [Qemu-devel] [PATCH 00/23] block migration: Fixes, cleanups and speedups Anthony Liguori
2009-11-30 18:50   ` Pierre Riteau
2009-11-30 19:23     ` Pierre Riteau
2009-11-30 19:34       ` [Qemu-devel] [PATCH 24/23] block migration: Skip zero-sized disks Jan Kiszka
2009-11-30 19:25     ` [Qemu-devel] [PATCH 00/23] block migration: Fixes, cleanups and speedups Jan Kiszka
2009-11-30 19:34       ` Pierre Riteau
2009-11-30 19:44         ` Jan Kiszka
2009-11-30 18:50   ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091130172121.22889.19699.stgit@mchn012c.ww002.siemens.net \
    --to=jan.kiszka@siemens.com \
    --cc=aliguori@us.ibm.com \
    --cc=lirans@il.ibm.com \
    --cc=pierre.riteau@irisa.fr \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).