Blame SOURCES/0008-python-Implement-can_multi_conn.patch

efa7a1
From 2a85ce81ad95eb2f9b2f29666480b814ea0f80d9 Mon Sep 17 00:00:00 2001
efa7a1
From: "Richard W.M. Jones" <rjones@redhat.com>
efa7a1
Date: Thu, 21 Nov 2019 16:46:11 +0000
efa7a1
Subject: [PATCH] python: Implement can_multi_conn.
efa7a1
efa7a1
(cherry picked from commit 21dd7bf49d3238c7e75918d4bf324b617f458d83)
efa7a1
---
efa7a1
 plugins/python/nbdkit-python-plugin.pod | 8 +++++++-
efa7a1
 plugins/python/python.c                 | 7 +++++++
efa7a1
 2 files changed, 14 insertions(+), 1 deletion(-)
efa7a1
efa7a1
diff --git a/plugins/python/nbdkit-python-plugin.pod b/plugins/python/nbdkit-python-plugin.pod
efa7a1
index 1f1c30f..b92bb56 100644
efa7a1
--- a/plugins/python/nbdkit-python-plugin.pod
efa7a1
+++ b/plugins/python/nbdkit-python-plugin.pod
efa7a1
@@ -187,6 +187,13 @@ contents will be garbage collected.
efa7a1
  def is_rotational(h):
efa7a1
    # return a boolean
efa7a1
 
efa7a1
+=item C<can_multi_conn>
efa7a1
+
efa7a1
+(Optional)
efa7a1
+
efa7a1
+ def can_multi_conn(h):
efa7a1
+   # return a boolean
efa7a1
+
efa7a1
 =item C<can_write>
efa7a1
 
efa7a1
 (Optional)
efa7a1
@@ -341,7 +348,6 @@ C<magic_config_key>,
efa7a1
 C<can_fua>,
efa7a1
 C<can_cache>,
efa7a1
 C<can_extents>,
efa7a1
-C<can_multi_conn>,
efa7a1
 C<extents>.
efa7a1
 
efa7a1
 These are not yet supported.
efa7a1
diff --git a/plugins/python/python.c b/plugins/python/python.c
efa7a1
index 38fc119..b186b99 100644
efa7a1
--- a/plugins/python/python.c
efa7a1
+++ b/plugins/python/python.c
efa7a1
@@ -779,6 +779,12 @@ py_is_rotational (void *handle)
efa7a1
   return boolean_callback (handle, "is_rotational", NULL);
efa7a1
 }
efa7a1
 
efa7a1
+static int
efa7a1
+py_can_multi_conn (void *handle)
efa7a1
+{
efa7a1
+  return boolean_callback (handle, "can_multi_conn", NULL);
efa7a1
+}
efa7a1
+
efa7a1
 static int
efa7a1
 py_can_write (void *handle)
efa7a1
 {
efa7a1
@@ -832,6 +838,7 @@ static struct nbdkit_plugin plugin = {
efa7a1
 
efa7a1
   .get_size          = py_get_size,
efa7a1
   .is_rotational     = py_is_rotational,
efa7a1
+  .can_multi_conn    = py_can_multi_conn,
efa7a1
   .can_write         = py_can_write,
efa7a1
   .can_flush         = py_can_flush,
efa7a1
   .can_trim          = py_can_trim,
efa7a1
-- 
efa7a1
2.18.2
efa7a1