From patchwork Fri Jun 7 14:15:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Yuan X-Patchwork-Id: 249734 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 959A52C008E for ; Sat, 8 Jun 2013 00:18:50 +1000 (EST) Received: from localhost ([::1]:56877 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkxVA-0008Cm-JP for incoming@patchwork.ozlabs.org; Fri, 07 Jun 2013 10:18:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkxTh-0006Sy-0z for qemu-devel@nongnu.org; Fri, 07 Jun 2013 10:17:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkxTc-0002AU-GM for qemu-devel@nongnu.org; Fri, 07 Jun 2013 10:17:16 -0400 Received: from mail-pd0-f181.google.com ([209.85.192.181]:49188) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkxTc-00027y-9M for qemu-devel@nongnu.org; Fri, 07 Jun 2013 10:17:12 -0400 Received: by mail-pd0-f181.google.com with SMTP id 14so2213541pdj.40 for ; Fri, 07 Jun 2013 07:17:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=JsoCM9qfGVG3flbyBd9u8C/rL3zXE/dqMsdUjDR2Muw=; b=qIdSIJAMmXU40GjvbVP482m0Q0N8wFJgMtFQtnSbgSbypGynGyChb6vNMbLbuu5gjE rEBsMPIvsUy+KrDNuBmqAglA6DXIs9oSI/GeNXevtpOr1khi5CGeLYsFhKFMaySARkko hvkQwxxoPLIrZOlT1OKAqBR1/Tmmv637cyBXXgiGgmzG/N1y1rQx7f+kmSp6zMKqsXEz enUuXbpwkRWOmwe6LSdlLxsE4y6C7czfb2kmI2jSLhn9FJcXP1ZUKdTPROR890kfraNo 6VkUS9Ty/NGFd+DVjQGSJ+nM3B4rdUt821n5pPJPPb1SOLRPMW5w3j6rl9Ke+23tcUbq B2Fw== X-Received: by 10.66.139.8 with SMTP id qu8mr3028027pab.132.1370614631593; Fri, 07 Jun 2013 07:17:11 -0700 (PDT) Received: from localhost.localdomain ([124.160.216.103]) by mx.google.com with ESMTPSA id cc15sm3365487pac.1.2013.06.07.07.17.02 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Jun 2013 07:17:10 -0700 (PDT) From: Liu Yuan To: sheepdog@lists.wpkg.org Date: Fri, 7 Jun 2013 22:15:50 +0800 Message-Id: <1370614552-4288-2-git-send-email-namei.unix@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1370614552-4288-1-git-send-email-namei.unix@gmail.com> References: <1370614552-4288-1-git-send-email-namei.unix@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.192.181 Cc: Kevin Wolf , Stefan Hajnoczi , qemu-devel@nongnu.org, MORITA Kazutaka Subject: [Qemu-devel] [PATCH v2 1/2] sheepdog: fix snapshot tag initialization X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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);