From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ul0sX-0004Db-8A for qemu-devel@nongnu.org; Fri, 07 Jun 2013 13:55:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ul0sV-0008TR-39 for qemu-devel@nongnu.org; Fri, 07 Jun 2013 13:55:09 -0400 Received: from mail-pb0-x236.google.com ([2607:f8b0:400e:c01::236]:40701) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ul0sU-0008Sr-Sh for qemu-devel@nongnu.org; Fri, 07 Jun 2013 13:55:07 -0400 Received: by mail-pb0-f54.google.com with SMTP id ro2so4978868pbb.13 for ; Fri, 07 Jun 2013 10:55:06 -0700 (PDT) From: Liu Yuan Date: Sat, 8 Jun 2013 01:54:25 +0800 Message-Id: <1370627666-6689-2-git-send-email-namei.unix@gmail.com> In-Reply-To: <1370627666-6689-1-git-send-email-namei.unix@gmail.com> References: <1370627666-6689-1-git-send-email-namei.unix@gmail.com> Subject: [Qemu-devel] [PATCH 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