aboutsummaryrefslogtreecommitdiffstats
path: root/tools/blktap/blkcow.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/blktap/blkcow.c')
-rw-r--r--tools/blktap/blkcow.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/blktap/blkcow.c b/tools/blktap/blkcow.c
new file mode 100644
index 0000000000..82f933589d
--- /dev/null
+++ b/tools/blktap/blkcow.c
@@ -0,0 +1,31 @@
+/* blkcow.c
+ *
+ * copy on write a block device. in a really inefficient way.
+ *
+ * (c) 2004 Andrew Warfield.
+ *
+ * This uses whatever backend the tap is attached to as the read-only
+ * underlay -- for the moment.
+ *
+ * Xend has been modified to use an amorfs:[fsid] disk tag.
+ * This will show up as device type (maj:240,min:0) = 61440.
+ *
+ * The fsid is placed in the sec_start field of the disk extent,
+ * the cow plugin uses this to identify a unique overlay.
+ */
+
+#include "blktaplib.h"
+#include "blkcowlib.h"
+
+
+int main(int argc, char *argv[])
+{
+ cow_init();
+
+ blktap_register_ctrl_hook("cow_control", cow_control);
+ blktap_register_request_hook("cow_request", cow_request);
+ blktap_register_response_hook("cow_response", cow_response);
+ blktap_listen();
+
+ return 0;
+}