This patch is part of the Fast Virtual Disk (FVD) proposal. See http://wiki.qemu.org/Features/FVD.
This patch adds FVD's implementation of the bdrv_probe() interface. Signed-off-by: Chunqiang Tang <ct...@us.ibm.com> --- block/fvd-misc.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/block/fvd-misc.c b/block/fvd-misc.c index 61e39bb..6315218 100644 --- a/block/fvd-misc.c +++ b/block/fvd-misc.c @@ -163,7 +163,14 @@ static void fvd_close(BlockDriverState * bs) static int fvd_probe(const uint8_t * buf, int buf_size, const char *filename) { - return 0; + const FvdHeader *header = (const void *)buf; + + if (buf_size >= sizeof(uint32_t) && + le32_to_cpu(header->magic) == FVD_MAGIC) { + return 100; + } else { + return 0; + } } static int fvd_is_allocated(BlockDriverState * bs, int64_t sector_num, -- 1.7.0.4