aboutsummaryrefslogtreecommitdiff
path: root/block.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-06-14 16:55:02 +0200
committerKevin Wolf <kwolf@redhat.com>2012-07-09 15:53:02 +0200
commit4ddc07cac2bd794e4ff17717551e66589e71e714 (patch)
tree024b42c29733b2fac56495de095b30f11665f1db /block.h
parenta9fc4408e3511a073583a18b98a26765ff1e21d7 (diff)
downloadqemu-4ddc07cac2bd794e4ff17717551e66589e71e714.zip
qemu-4ddc07cac2bd794e4ff17717551e66589e71e714.tar.gz
qemu-4ddc07cac2bd794e4ff17717551e66589e71e714.tar.bz2
block: introduce bdrv_swap, implement bdrv_append on top of it
The new function can be made a bit nicer than bdrv_append. It swaps the whole contents, and then swaps back (using the usual t=a;a=b;b=t idiom) the fields that need to stay on top. Thus, it does not need explicit bdrv_detach_dev, bdrv_iostatus_disable, etc. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.h')
-rw-r--r--block.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/block.h b/block.h
index 42e30d6..3af93c6 100644
--- a/block.h
+++ b/block.h
@@ -122,6 +122,7 @@ int bdrv_create(BlockDriver *drv, const char* filename,
int bdrv_create_file(const char* filename, QEMUOptionParameter *options);
BlockDriverState *bdrv_new(const char *device_name);
void bdrv_make_anon(BlockDriverState *bs);
+void bdrv_swap(BlockDriverState *bs_new, BlockDriverState *bs_old);
void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top);
void bdrv_delete(BlockDriverState *bs);
int bdrv_parse_cache_flags(const char *mode, int *flags);