aboutsummaryrefslogtreecommitdiff
path: root/block_int.h
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-11-14 15:09:45 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2011-11-21 14:58:48 -0600
commit0f15423c3234335ca0dbeeae6d19db4699faca07 (patch)
tree1850ee9f90d919d1b6209d5046a6246686902f63 /block_int.h
parent38e0735eb76a1479917ef3501a208d4f70998494 (diff)
downloadqemu-0f15423c3234335ca0dbeeae6d19db4699faca07.zip
qemu-0f15423c3234335ca0dbeeae6d19db4699faca07.tar.gz
qemu-0f15423c3234335ca0dbeeae6d19db4699faca07.tar.bz2
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 <aliguori@us.ibm.com>
Diffstat (limited to 'block_int.h')
-rw-r--r--block_int.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/block_int.h b/block_int.h
index 1ec4921..77c0187 100644
--- a/block_int.h
+++ b/block_int.h
@@ -88,6 +88,11 @@ struct BlockDriver {
int64_t sector_num, int nb_sectors);
/*
+ * Invalidate any cached meta-data.
+ */
+ void (*bdrv_invalidate_cache)(BlockDriverState *bs);
+
+ /*
* Flushes all data that was already written to the OS all the way down to
* the disk (for example raw-posix calls fsync()).
*/