From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ul0Lf-0002cE-Gs for qemu-devel@nongnu.org; Fri, 07 Jun 2013 13:21:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ul0Le-0005Nj-Ni for qemu-devel@nongnu.org; Fri, 07 Jun 2013 13:21:11 -0400 Received: from mail-pa0-x233.google.com ([2607:f8b0:400e:c03::233]:56028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ul0Le-0005Na-AP for qemu-devel@nongnu.org; Fri, 07 Jun 2013 13:21:10 -0400 Received: by mail-pa0-f51.google.com with SMTP id lf11so71324pab.38 for ; Fri, 07 Jun 2013 10:21:09 -0700 (PDT) From: Liu Yuan Date: Sat, 8 Jun 2013 01:20:39 +0800 Message-Id: <1370625640-5469-2-git-send-email-namei.unix@gmail.com> In-Reply-To: <1370625640-5469-1-git-send-email-namei.unix@gmail.com> References: <1370625640-5469-1-git-send-email-namei.unix@gmail.com> Subject: [Qemu-devel] [PATCH v3 1/2] sheepdog: fix snapshot tag initialization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: sheepdog@lists.wpkg.org Cc: Kevin Wolf , Stefan Hajnoczi , qemu-devel@nongnu.org, MORITA Kazutaka 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 --- block/sheepdog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 21a4edf..94218ac 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); -- 1.7.9.5