qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 08/10] qed: add bdrv_post_incoming_migration


From: Benoît Canet
Subject: Re: [Qemu-devel] [RFC PATCH 08/10] qed: add bdrv_post_incoming_migration operation checking the image
Date: Tue, 20 Mar 2012 16:52:41 +0100


So should I drop the "block: rename *_invalidate_cache_* to *_post_incoming_migration_*" commit ?

On Tue, Mar 20, 2012 at 4:42 PM, Stefan Hajnoczi <address@hidden> wrote:
On Tue, Mar 06, 2012 at 06:32:27PM +0100, Benoît Canet wrote:
> @@ -1529,6 +1529,19 @@ static int bdrv_qed_change_backing_file(BlockDriverState *bs,
>      return ret;
>  }
>
> +static void bdrv_qed_check_if_needed(BlockDriverState *bs)
> +{
> +    /* close the block device if the verification fail */
> +    if (check_image_if_needed(bs)) {
> +        bdrv_close(bs);
> +    }

We open the image for incoming migration while the VM is still running.
That means the metadata and header can still change before migration
switchover.  So we need to drop everything we know about this image and
start from scratch.

qcow2 does it like this:

qcow2_close(bs);
memset(s, 0, sizeof(BDRVQcowState));
qcow2_open(bs, flags);

We should do something similar so that the QED header is re-read.  This
probably means check_image_if_needed() doesn't need to be factored out
of qed_open().

(Note that the underlying file and BlockDriverState don't get reopened,
we're simply reinitializing the QED/QCOW2 image format layer here.)

Stefan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]