From 5a8a30db4771675480829d7d3bf35a138e9c35f1 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Wed, 12 Mar 2014 15:59:16 +0100 Subject: 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 Reviewed-by: Juan Quintela Reviewed-by: Eric Blake Reviewed-by: Benoit Canet --- migration.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'migration.c') diff --git a/migration.c b/migration.c index 00f465e..e0e24d4 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(); -- cgit v1.1