This patch revives VDI locking mechanism. When two or more clients (QEMU and tgt) try to open one VDI, sheep returns an error to the later one.
Example: $ sudo qemu-system-x86_64 -hda sheepdog:debian qemu-system-x86_64: -hda sheepdog:debian: could not open disk image sheepdog:debian: cannot get vdi info, VDI isn't locked, \ debian 0 v3: - renaming functions v2: - Changes for QEMU side are needless - Manual unlocking is required for keeping data integrity -- New dog subcommands are provided for this purpose Hitoshi Mitake (7): sheep: change a prototype of process_main() for obtaining sender information sheep: revive lock operation dog: use GET_VDI_INFO unconditionally in dog sheep: snapshot and collect vdi state during joining to cluster sheep: a new helper function for formatting struct node_id dog: add a new subcommand "dog vdi lock list" for listing vdi locking status dog: add a new subcommand "dog vdi lock force-unlock" for unlocking VDI forcibly dog/treeview.c | 41 ++++++++ dog/treeview.h | 2 + dog/vdi.c | 96 +++++++++++++++++- include/internal_proto.h | 23 +++++ include/sheep.h | 11 +- include/sheepdog_proto.h | 6 ++ sheep/group.c | 165 ++++++++++++++++++++++++++++-- sheep/ops.c | 177 +++++++++++++++++++++++++-------- sheep/request.c | 3 +- sheep/sheep.c | 2 + sheep/sheep_priv.h | 24 +++-- sheep/vdi.c | 254 +++++++++++++++++++++++++++++++++++++++++++++++ 12 files changed, 736 insertions(+), 68 deletions(-) -- 1.8.3.2 -- sheepdog mailing list sheepdog@lists.wpkg.org http://lists.wpkg.org/mailman/listinfo/sheepdog