From 33e3963e1b9298e01cadd738124f0e618b5b79f5 Mon Sep 17 00:00:00 2001 From: bellard Date: Sun, 6 Jul 2003 17:15:21 +0000 Subject: added user mode Linux Copy On Write disk image support - added -snapshot support (initial patch by Rusty Russell) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@309 c046a42c-6fe2-441c-8c8c-71466251a162 --- vl.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'vl.h') diff --git a/vl.h b/vl.h index 87b569d0f6..fa7d5da274 100644 --- a/vl.h +++ b/vl.h @@ -24,16 +24,32 @@ #ifndef VL_H #define VL_H +/* vl.c */ +void *get_mmap_addr(unsigned long size); + /* block.c */ typedef struct BlockDriverState BlockDriverState; -BlockDriverState *bdrv_open(const char *filename); +BlockDriverState *bdrv_open(const char *filename, int snapshot); void bdrv_close(BlockDriverState *bs); int bdrv_read(BlockDriverState *bs, int64_t sector_num, uint8_t *buf, int nb_sectors); int bdrv_write(BlockDriverState *bs, int64_t sector_num, const uint8_t *buf, int nb_sectors); void bdrv_get_geometry(BlockDriverState *bs, int64_t *nb_sectors_ptr); +int bdrv_commit(BlockDriverState *bs); + +/* user mode linux compatible COW file */ +#define COW_MAGIC 0x4f4f4f4d /* MOOO */ +#define COW_VERSION 2 +struct cow_header_v2 { + uint32_t magic; + uint32_t long version; + char backing_file[1024]; + int32_t mtime; + uint64_t size; + uint32_t sectorsize; +}; #endif /* VL_H */ -- cgit v1.2.1