dog command needs to read/write inode objects for various operations
e.g. taking snapshot. The operations shouldn't be prevented by locks
acquired by other clients (QEMU and tgt). SD_OP_GET_VDI_INFO doesn't
try to acquire the lock, so dog command should use it unconditionally.

Signed-off-by: Hitoshi Mitake <mitake.hito...@lab.ntt.co.jp>
---
 dog/vdi.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/dog/vdi.c b/dog/vdi.c
index 49a2139..07d653a 100644
--- a/dog/vdi.c
+++ b/dog/vdi.c
@@ -316,10 +316,7 @@ static int find_vdi_name(const char *vdiname, uint32_t 
snapid, const char *tag,
        if (tag)
                pstrcpy(buf + SD_MAX_VDI_LEN, SD_MAX_VDI_TAG_LEN, tag);
 
-       if (for_snapshot)
-               sd_init_req(&hdr, SD_OP_GET_VDI_INFO);
-       else
-               sd_init_req(&hdr, SD_OP_LOCK_VDI);
+       sd_init_req(&hdr, SD_OP_GET_VDI_INFO);
        hdr.data_length = SD_MAX_VDI_LEN + SD_MAX_VDI_TAG_LEN;
        hdr.flags = SD_FLAG_CMD_WRITE;
        hdr.vdi.snapid = snapid;
-- 
1.7.1

-- 
sheepdog mailing list
sheepdog@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to