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

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