[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] block: Add error handling to bdrv_invalidate_ca
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] block: Add error handling to bdrv_invalidate_cache() |
Date: |
Wed, 12 Mar 2014 09:40:39 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
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 <address@hidden>
> ---
> 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 <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature