Displaying 8 results from an estimated 8 matches for "reflection_can_multi_conn".
2019 Sep 28
0
[PATCH nbdkit v2 2/4] Rename nbdkit-reflection-plugin to nbdkit-info-plugin.
...struct handle *h = handle;
@@ -298,7 +298,7 @@ reflection_close (void *handle)
/* Get the disk size. */
static int64_t
-reflection_get_size (void *handle)
+info_get_size (void *handle)
{
struct handle *h = handle;
@@ -306,7 +306,7 @@ reflection_get_size (void *handle)
}
static int
-reflection_can_multi_conn (void *handle)
+info_can_multi_conn (void *handle)
{
switch (mode) {
/* Safe for exportname modes since clients should only request
@@ -329,7 +329,7 @@ reflection_can_multi_conn (void *handle)
/* Cache. */
static int
-reflection_can_cache (void *handle)
+info_can_cache (void *handle)...
2019 Sep 15
0
Re: [PATCH nbdkit 0/4] Reflection plugin, peer name.
...tion.c b/plugins/reflection/reflection.c
index a0d7c60..f765557 100644
--- a/plugins/reflection/reflection.c
+++ b/plugins/reflection/reflection.c
@@ -303,11 +303,22 @@ reflection_get_size (void *handle)
return (int64_t) h->len;
}
-/* Read-only plugin so multi-conn is safe. */
static int
reflection_can_multi_conn (void *handle)
{
- return 1;
+ switch (mode) {
+ /* Safe for exportname modes since clients should only request
+ * multi-conn with the same export name.
+ */
+ case MODE_EXPORTNAME:
+ case MODE_BASE64EXPORTNAME:
+ return 1;
+ /* Unsafe for mode=address because all multi-conn...
2019 Sep 15
13
[PATCH nbdkit 0/4] Reflection plugin, peer name.
This series is based on my blog posting here:
https://rwmj.wordpress.com/2019/09/13/nbdkit-supports-exportnames/
It depends on the fix for realloc:
https://www.redhat.com/archives/libguestfs/2019-September/thread.html#00103
This series adds a fun plugin, and also an semi-related feature I've
long thought to be desirable. You can consider patches 1 & 4, and
patches 2 & 3 as forming
2019 Sep 28
2
[PATCH nbdkit 1/2] common/include: Add function for subtracting struct timeval.
---
common/include/test-tvdiff.c | 75 +++++++++++++++++++++++++++++-------
common/include/tvdiff.h | 13 ++++++-
2 files changed, 74 insertions(+), 14 deletions(-)
diff --git a/common/include/test-tvdiff.c b/common/include/test-tvdiff.c
index 9cbcfc0..abefb2e 100644
--- a/common/include/test-tvdiff.c
+++ b/common/include/test-tvdiff.c
@@ -36,7 +36,6 @@
#include <stdlib.h>
#include
2019 Sep 15
0
[PATCH nbdkit 1/4] Add reflection plugin.
...free (h->data);
+ free (h);
+}
+
+#define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL
+
+/* Get the disk size. */
+static int64_t
+reflection_get_size (void *handle)
+{
+ struct handle *h = handle;
+
+ return (int64_t) h->len;
+}
+
+/* Read-only plugin so multi-conn is safe. */
+static int
+reflection_can_multi_conn (void *handle)
+{
+ return 1;
+}
+
+/* Cache. */
+static int
+reflection_can_cache (void *handle)
+{
+ /* Everything is already in memory, returning this without
+ * implementing .cache lets nbdkit do the correct no-op.
+ */
+ return NBDKIT_CACHE_NATIVE;
+}
+
+/* Read data. */
+static int
+r...
2019 Sep 28
0
[PATCH nbdkit 2/2] reflection: Add mode for reflecting server time.
...IME:
+ gettimeofday (&h->conn_t, NULL);
+ h->len = 12;
+ h->data = malloc (h->len);
+ if (h->data == NULL) {
+ nbdkit_error ("malloc: %m");
+ free (h);
+ return NULL;
+ }
+ return h;
+
default:
abort ();
}
@@ -320,6 +356,13 @@ reflection_can_multi_conn (void *handle)
*/
case MODE_ADDRESS:
return 0;
+ /* All time modes will read different values at different times,
+ * so all of them are unsafe for multi-conn.
+ */
+ case MODE_TIME:
+ case MODE_UPTIME:
+ case MODE_CONNTIME:
+ return 0;
/* Keep GCC happy. */...
2019 Sep 28
9
[PATCH nbdkit v2 0/4] info: Add mode for sending back server time.
v1 was:
https://www.redhat.com/archives/libguestfs/2019-September/thread.html#00361
v2:
- Adds a patch to rename the reflection plugin to the info plugin.
- Adds tests.
Rich.
2019 Sep 16
2
Re: [PATCH nbdkit 1/4] Add reflection plugin.
...ed output.
> + *
> + * - Inputs that could hang, crash or exploit the server.
> + */
Nice reminder. I agree that we're okay for now, but as we add new modes
in the future, it will remind us to think about it.
> +/* Read-only plugin so multi-conn is safe. */
> +static int
> +reflection_can_multi_conn (void *handle)
> +{
> + return 1;
Correct for now. I also see your followup to patch 4 that changes this
once IP addresses are exposed.
> +++ b/tests/test-reflection-base64.sh
> +
> +requires nbdsh --version
> +# XXX This needs to test $PYTHON somehow.
> +#requires python...