From: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
sheepdog@lists.wpkg.org, mitake.hitoshi@gmail.com,
Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>,
Stefan Hajnoczi <stefanha@redhat.com>,
Liu Yuan <namei.unix@gmail.com>,
MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Subject: [Qemu-devel] [PATCH 1/2] sheepdog: adopting protocol update for VDI locking
Date: Thu, 7 Aug 2014 16:28:39 +0900 [thread overview]
Message-ID: <1407396520-2720-2-git-send-email-mitake.hitoshi@lab.ntt.co.jp> (raw)
In-Reply-To: <1407396520-2720-1-git-send-email-mitake.hitoshi@lab.ntt.co.jp>
The update is required for supporting iSCSI multipath. It doesn't
affect behavior of QEMU driver but adding a new field to vdi request
struct is required.
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Liu Yuan <namei.unix@gmail.com>
Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
---
block/sheepdog.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/block/sheepdog.c b/block/sheepdog.c
index 8d9350c..36f76f0 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -103,6 +103,9 @@
#define SD_INODE_SIZE (sizeof(SheepdogInode))
#define CURRENT_VDI_ID 0
+#define LOCK_TYPE_NORMAL 1
+#define LOCK_TYPE_SHARED 2 /* for iSCSI multipath */
+
typedef struct SheepdogReq {
uint8_t proto_ver;
uint8_t opcode;
@@ -166,7 +169,8 @@ typedef struct SheepdogVdiReq {
uint8_t copy_policy;
uint8_t reserved[2];
uint32_t snapid;
- uint32_t pad[3];
+ uint32_t type;
+ uint32_t pad[2];
} SheepdogVdiReq;
typedef struct SheepdogVdiRsp {
@@ -1090,6 +1094,7 @@ static int find_vdi_name(BDRVSheepdogState *s, const char *filename,
memset(&hdr, 0, sizeof(hdr));
if (lock) {
hdr.opcode = SD_OP_LOCK_VDI;
+ hdr.type = LOCK_TYPE_NORMAL;
} else {
hdr.opcode = SD_OP_GET_VDI_INFO;
}
@@ -1793,6 +1798,7 @@ static void sd_close(BlockDriverState *bs)
memset(&hdr, 0, sizeof(hdr));
hdr.opcode = SD_OP_RELEASE_VDI;
+ hdr.type = LOCK_TYPE_NORMAL;
hdr.base_vdi_id = s->inode.vdi_id;
wlen = strlen(s->name) + 1;
hdr.data_length = wlen;
--
1.8.3.2
next prev parent reply other threads:[~2014-08-07 7:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-07 7:28 [Qemu-devel] [PATCH 0/2] sheepdog driver update related to VDI locking feature Hitoshi Mitake
2014-08-07 7:28 ` Hitoshi Mitake [this message]
2014-08-08 5:20 ` [Qemu-devel] [PATCH 1/2] sheepdog: adopting protocol update for VDI locking Liu Yuan
2014-08-08 6:12 ` Hitoshi Mitake
2014-08-08 7:49 ` Liu Yuan
2014-08-11 2:17 ` Hitoshi Mitake
2014-08-11 3:34 ` Liu Yuan
2014-08-11 3:43 ` Liu Yuan
2014-08-07 7:28 ` [Qemu-devel] [PATCH 2/2] sheepdog: improve error handling for a case of failed lock Hitoshi Mitake
2014-08-08 5:31 ` Liu Yuan
2014-08-08 6:17 ` Hitoshi Mitake
2014-08-08 6:43 ` Liu Yuan
2014-08-11 2:35 ` Hitoshi Mitake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1407396520-2720-2-git-send-email-mitake.hitoshi@lab.ntt.co.jp \
--to=mitake.hitoshi@lab.ntt.co.jp \
--cc=kwolf@redhat.com \
--cc=mitake.hitoshi@gmail.com \
--cc=morita.kazutaka@lab.ntt.co.jp \
--cc=namei.unix@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=sheepdog@lists.wpkg.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).