On 03/12/2014 09:00 AM, Kevin Wolf wrote: > If it returns an error, the migrated VM will not be started, but qemu > exits with an error message. > > Signed-off-by: Kevin Wolf <[email protected]> > --- > block.c | 28 ++++++++++++++++++++++------ > block/qcow2.c | 22 +++++++++++++++++++--- > block/qed.c | 21 ++++++++++++++++++--- > include/block/block.h | 4 ++-- > include/block/block_int.h | 2 +- > migration.c | 8 +++++++- > 6 files changed, 69 insertions(+), 16 deletions(-) >
> @@ -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);
Freeing before exit() is wasted cpu cycles, but doesn't hurt the common
case, and keeping the error_free() makes valgrind a bit happier, so I'm
not opposed to leaving it as-is.
Reviewed-by: Eric Blake <[email protected]>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
