aboutsummaryrefslogtreecommitdiff
path: root/block_int.h
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>2011-11-14 12:44:19 +0000
committerKevin Wolf <kwolf@redhat.com>2011-12-05 14:51:36 +0100
commit376ae3f1cb5a08f53c9425bfaf90b3f70ab240f1 (patch)
treef66c28d20b2756d4768551c711b5697ac8bfaf5a /block_int.h
parent05c4af54c670f5143bd4ac5d79aa1ef53a9f31ca (diff)
block: add .bdrv_co_is_allocated()
This patch adds the .bdrv_co_is_allocated() interface which is identical to .bdrv_is_allocated() but runs in coroutine context. Running in coroutine context implies that other coroutines might be performing I/O at the same time. Therefore it must be safe to run while the following BlockDriver functions are in-flight: .bdrv_co_readv() .bdrv_co_writev() .bdrv_co_flush() .bdrv_co_is_allocated() The new .bdrv_co_is_allocated() interface is useful because it can be used when a VM is running, whereas .bdrv_is_allocated() is a synchronous interface that does not cope with parallel requests. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block_int.h')
-rw-r--r--block_int.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/block_int.h b/block_int.h
index e2799e4f6b..d5b5457d90 100644
--- a/block_int.h
+++ b/block_int.h
@@ -103,6 +103,8 @@ struct BlockDriver {
int64_t sector_num, int nb_sectors, QEMUIOVector *qiov);
int coroutine_fn (*bdrv_co_discard)(BlockDriverState *bs,
int64_t sector_num, int nb_sectors);
+ int coroutine_fn (*bdrv_co_is_allocated)(BlockDriverState *bs,
+ int64_t sector_num, int nb_sectors, int *pnum);
/*
* Invalidate any cached meta-data.