From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkYpm-000291-SN for qemu-devel@nongnu.org; Thu, 06 Jun 2013 07:58:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkYpl-0008SR-Qw for qemu-devel@nongnu.org; Thu, 06 Jun 2013 07:58:26 -0400 Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]:48662) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkYpl-0008SL-LJ for qemu-devel@nongnu.org; Thu, 06 Jun 2013 07:58:25 -0400 Received: by mail-pa0-f47.google.com with SMTP id kl13so1679854pab.6 for ; Thu, 06 Jun 2013 04:58:24 -0700 (PDT) From: Liu Yuan Date: Thu, 6 Jun 2013 19:57:28 +0800 Message-Id: <1370519849-10620-2-git-send-email-namei.unix@gmail.com> In-Reply-To: <1370519849-10620-1-git-send-email-namei.unix@gmail.com> References: <1370519849-10620-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 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