aboutsummaryrefslogtreecommitdiff
path: root/migration.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2014-03-12 15:59:16 +0100
committerKevin Wolf <kwolf@redhat.com>2014-03-19 09:39:41 +0100
commit5a8a30db4771675480829d7d3bf35a138e9c35f1 (patch)
treef9ea39c07db48ca7edd89c462e45a2451682014e /migration.c
parent059b3527f0229f4d60fd77a317503d42abd5e50f (diff)
block: Add error handling to bdrv_invalidate_cache()
If it returns an error, the migrated VM will not be started, but qemu exits with an error message. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net>
Diffstat (limited to 'migration.c')
-rw-r--r--migration.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/migration.c b/migration.c
index 00f465ea46..e0e24d42c7 100644
--- a/migration.c
+++ b/migration.c
@@ -101,6 +101,7 @@ void qemu_start_incoming_migration(const char *uri, Error **errp)
static void process_incoming_migration_co(void *opaque)
{
QEMUFile *f = opaque;
+ Error *local_err = NULL;
int ret;
ret = qemu_loadvm_state(f);
@@ -115,7 +116,12 @@ static void process_incoming_migration_co(void *opaque)
bdrv_clear_incoming_migration_all();
/* Make sure all file formats flush their mutable metadata */
- bdrv_invalidate_cache_all();
+ bdrv_invalidate_cache_all(&local_err);
+ if (local_err) {
+ qerror_report_err(local_err);
+ error_free(local_err);
+ exit(EXIT_FAILURE);
+ }
if (autostart) {
vm_start();