This plugin has a parallel thread model and handles flush correctly
across connections, so return NBD_FLAG_CAN_MULTI_CONN.
---
plugins/partitioning/partitioning.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/plugins/partitioning/partitioning.c b/plugins/partitioning/partitioning.c
index 43bdd7c..205c059 100644
--- a/plugins/partitioning/partitioning.c
+++ b/plugins/partitioning/partitioning.c
@@ -288,6 +288,13 @@ partitioning_get_size (void *handle)
return virtual_size (®ions);
}
+/* Serves the same data over multiple connections. */
+static int
+partitioning_can_multi_conn (void *handle)
+{
+ return 1;
+}
+
/* Read data. */
static int
partitioning_pread (void *handle, void *buf, uint32_t count, uint64_t offset)
@@ -416,6 +423,7 @@ static struct nbdkit_plugin plugin = {
.magic_config_key = "file",
.open = partitioning_open,
.get_size = partitioning_get_size,
+ .can_multi_conn = partitioning_can_multi_conn,
.pread = partitioning_pread,
.pwrite = partitioning_pwrite,
.flush = partitioning_flush,
--
2.19.2