From 0f15423c3234335ca0dbeeae6d19db4699faca07 Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Mon, 14 Nov 2011 15:09:45 -0600 Subject: block: allow migration to work with image files (v3) Image files have two types of data: immutable data that describes things like image size, backing files, etc. and mutable data that includes offset and reference count tables. Today, image formats aggressively cache mutable data to improve performance. In some cases, this happens before a guest even starts. When dealing with live migration, since a file is open on two machines, the caching of meta data can lead to data corruption. This patch addresses this by introducing a mechanism to invalidate any cached mutable data a block driver may have which is then used by the live migration code. NB, this still requires coherent shared storage. Addressing migration without coherent shared storage (i.e. NFS) requires additional work. Signed-off-by: Anthony Liguori --- migration.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'migration.c') diff --git a/migration.c b/migration.c index 6764d3a44c..8280d7189a 100644 --- a/migration.c +++ b/migration.c @@ -89,6 +89,9 @@ void process_incoming_migration(QEMUFile *f) qemu_announce_self(); DPRINTF("successfully loaded vm state\n"); + /* Make sure all file formats flush their mutable metadata */ + bdrv_invalidate_cache_all(); + if (autostart) { vm_start(); } else { -- cgit v1.2.1