On Tue, Feb 26, 2013 at 06:40:16PM +0800, Wenchao Xia wrote: > Compared to bdrv_can_snapshot(), this function return whether > bs* is ready to read snapshot info from instead of write. If yes, > caller can then query snapshot information, but taking snapshot > is not always possible for that *bs may be read only. > > Signed-off-by: Wenchao Xia <xiaw...@linux.vnet.ibm.com> > Reviewed-by: Eric Blake <ebl...@redhat.com> > --- > block.c | 19 +++++++++++++++++++ > include/block/block.h | 1 + > 2 files changed, 20 insertions(+), 0 deletions(-) > > diff --git a/block.c b/block.c > index 50dab8e..19c2d7b 100644 > --- a/block.c > +++ b/block.c > @@ -3058,6 +3058,25 @@ bool bdrv_debug_is_suspended(BlockDriverState *bs, > const char *tag) > /**************************************************************/ > /* handling of snapshots */ > > +/* return whether internal snapshot can be read on @bs */ > +bool bdrv_can_read_snapshot(BlockDriverState *bs)
Which operations are included in "read a snapshot"? Candidate list: * bdrv_snapshot_load_tmp() * bdrv_snapshot_list() * bdrv_snapshot_dump() * bdrv_load_vmstate() * others? Please document the meaning of this function so that others can use/modify it correctly in the future. Stefan