From b579ffb3fd64243b64ac5aaf659ac88518f17835 Mon Sep 17 00:00:00 2001 From: Liu Yuan Date: Sat, 8 Jun 2013 01:54:25 +0800 Subject: [PATCH] sheepdog: fix snapshot tag initialization This is an old and obvious bug. We should pass snapshot_id to the tag. Or simple command like 'qemu-img snapshot -a tag sheepdog:image' will fail Cc: qemu-devel@nongnu.org Cc: MORITA Kazutaka Cc: Kevin Wolf Cc: Stefan Hajnoczi Reviewed-by: Kevin Wolf Signed-off-by: Liu Yuan Signed-off-by: Kevin Wolf --- block/sheepdog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 21a4edf15b..94218ac937 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -2063,7 +2063,7 @@ static int sd_snapshot_goto(BlockDriverState *bs, const char *snapshot_id) if (snapid) { tag[0] = 0; } else { - pstrcpy(tag, sizeof(tag), s->name); + pstrcpy(tag, sizeof(tag), snapshot_id); } ret = reload_inode(s, snapid, tag);