Patchwork [1/2] sheepdog: fix snapshot tag initialization

login
register
mail settings
Submitter namei.unix@gmail.com
Date June 6, 2013, 11:57 a.m.
Message ID <1370519849-10620-2-git-send-email-namei.unix@gmail.com>
Download mbox | patch
Permalink /patch/249395/
State New
Headers show

Comments

namei.unix@gmail.com - June 6, 2013, 11:57 a.m.
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 <morita.kazutaka@lab.ntt.co.jp>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
---
 block/sheepdog.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Kevin Wolf - June 6, 2013, 12:46 p.m.
Am 06.06.2013 um 13:57 hat Liu Yuan geschrieben:
> 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 <morita.kazutaka@lab.ntt.co.jp>
> Cc: Kevin Wolf <kwolf@redhat.com>
> Cc: Stefan Hajnoczi <stefanha@redhat.com>
> Signed-off-by: Liu Yuan <namei.unix@gmail.com>

Reviewed-by: Kevin Wolf <kwolf@redhat.com>

Patch

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);