Displaying 20 results from an estimated 45 matches for "plugin_is_rotational".
2017 Nov 15
1
[nbdkit PATCH] connections: Extract common export flag computation code
...AD_ONLY;
+ conn->readonly = 1;
+ }
+ if (!conn->readonly) {
+ eflags |= NBD_FLAG_SEND_WRITE_ZEROES;
+ }
+
+ fl = plugin_can_flush (conn);
+ if (fl == -1)
+ return -1;
+ if (fl) {
+ eflags |= NBD_FLAG_SEND_FLUSH | NBD_FLAG_SEND_FUA;
+ conn->can_flush = 1;
+ }
+
+ fl = plugin_is_rotational (conn);
+ if (fl == -1)
+ return -1;
+ if (fl) {
+ eflags |= NBD_FLAG_ROTATIONAL;
+ conn->is_rotational = 1;
+ }
+
+ fl = plugin_can_trim (conn);
+ if (fl == -1)
+ return -1;
+ if (fl) {
+ eflags |= NBD_FLAG_SEND_TRIM;
+ conn->can_trim = 1;
+ }
+
+ *flags = eflags;
+...
2016 Sep 27
1
Re: Memory corruption when testing nbdkit python plugin with nbd-tester-client?
...plugin_config (const char *key, const char *value)
plugin_config_complete (void)
plugin_open (struct connection *conn, int readonly)
plugin_close (struct connection *conn)
plugin_get_size (struct connection *conn)
plugin_can_write (struct connection *conn)
plugin_can_flush (struct connection *conn)
plugin_is_rotational (struct connection *conn)
plugin_can_trim (struct connection *conn)
That means dumping the plugin-internal data on connection close is not
locked against the requests within that connection, and any garbage
collection triggered by the last request may still be running while
plugin_close runs. Boom...
2018 Jan 16
0
[PATCH nbdkit 2/3] Refactor plugin_* functions into a backend struct.
...)
eflags |= NBD_FLAG_SEND_WRITE_ZEROES;
}
- fl = plugin_can_flush (conn);
+ fl = backend->can_flush (backend, conn);
if (fl == -1)
return -1;
if (fl) {
@@ -371,7 +373,7 @@ compute_eflags (struct connection *conn, uint16_t *flags)
conn->can_flush = 1;
}
- fl = plugin_is_rotational (conn);
+ fl = backend->is_rotational (backend, conn);
if (fl == -1)
return -1;
if (fl) {
@@ -379,7 +381,7 @@ compute_eflags (struct connection *conn, uint16_t *flags)
conn->is_rotational = 1;
}
- fl = plugin_can_trim (conn);
+ fl = backend->can_trim (backend, conn)...
2018 Jan 17
0
[PATCH 2/9] Refactor plugin_* functions into a backend struct.
...)
eflags |= NBD_FLAG_SEND_WRITE_ZEROES;
}
- fl = plugin_can_flush (conn);
+ fl = backend->can_flush (backend, conn);
if (fl == -1)
return -1;
if (fl) {
@@ -371,7 +373,7 @@ compute_eflags (struct connection *conn, uint16_t *flags)
conn->can_flush = 1;
}
- fl = plugin_is_rotational (conn);
+ fl = backend->is_rotational (backend, conn);
if (fl == -1)
return -1;
if (fl) {
@@ -379,7 +381,7 @@ compute_eflags (struct connection *conn, uint16_t *flags)
conn->is_rotational = 1;
}
- fl = plugin_can_trim (conn);
+ fl = backend->can_trim (backend, conn)...
2018 Jan 16
0
[PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend struct.
...)
eflags |= NBD_FLAG_SEND_WRITE_ZEROES;
}
- fl = plugin_can_flush (conn);
+ fl = backend->can_flush (backend, conn);
if (fl == -1)
return -1;
if (fl) {
@@ -371,7 +373,7 @@ compute_eflags (struct connection *conn, uint16_t *flags)
conn->can_flush = 1;
}
- fl = plugin_is_rotational (conn);
+ fl = backend->is_rotational (backend, conn);
if (fl == -1)
return -1;
if (fl) {
@@ -379,7 +381,7 @@ compute_eflags (struct connection *conn, uint16_t *flags)
conn->is_rotational = 1;
}
- fl = plugin_can_trim (conn);
+ fl = backend->can_trim (backend, conn)...
2018 Jan 16
4
[PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend
v1 -> v2:
- Fixed everything mentioned in the review.
Rich.
2018 Jan 16
6
[PATCH nbdkit 0/3] Refactor plugin_* functions into a backend struct.
Somewhat invasive but mostly mechanical change to how plugins are
called. This patch is in preparation for adding a second backend
subtype for filters.
Rich.
2020 Mar 17
0
[nbdkit PATCH 1/4] server: Normalize plugin can_* values
...t backend_plugin *p = container_of (b, struct backend_plugin, backend);
if (p->plugin.can_flush)
- return p->plugin.can_flush (handle);
+ return normalize_bool (p->plugin.can_flush (handle));
else
return p->plugin.flush || p->plugin._flush_v1;
}
@@ -336,7 +344,7 @@ plugin_is_rotational (struct backend *b, void *handle)
struct backend_plugin *p = container_of (b, struct backend_plugin, backend);
if (p->plugin.is_rotational)
- return p->plugin.is_rotational (handle);
+ return normalize_bool (p->plugin.is_rotational (handle));
else
return 0; /* assume f...
2020 Mar 17
1
Re: [nbdkit PATCH 1/4] server: Normalize plugin can_* values
...truct backend_plugin, backend);
>
> if (p->plugin.can_flush)
> - return p->plugin.can_flush (handle);
> + return normalize_bool (p->plugin.can_flush (handle));
> else
> return p->plugin.flush || p->plugin._flush_v1;
> }
> @@ -336,7 +344,7 @@ plugin_is_rotational (struct backend *b, void *handle)
> struct backend_plugin *p = container_of (b, struct backend_plugin, backend);
>
> if (p->plugin.is_rotational)
> - return p->plugin.is_rotational (handle);
> + return normalize_bool (p->plugin.is_rotational (handle));
> e...
2018 Jan 16
9
[nbdkit PATCH 0/7] Initial implementation of FUA flag passthrough
Tested via:
term1$ qemu-nbd -k $PWD/sock -t -f raw -x foo junk --trace=nbd_\*
term2$ ./nbdkit -f -v -e bar nbd socket=$PWD/sock export=foo
term3$ qemu-io -t none -f raw nbd://localhost:10809/bar --trace=nbd_\*
and checking the traces to see that 'w 0 1' vs. 'w -f 0 1' was able
to influence whether the FUA flag showed up at the server in term1.
Still to go: figure out how to
2018 Jan 17
0
[PATCH 5/9] connections: Allow multiple handles to be stored in the connection object.
...t_handle (conn, 0));
debug ("can_flush");
if (p->plugin.can_flush)
- return p->plugin.can_flush (connection_get_handle (conn));
+ return p->plugin.can_flush (connection_get_handle (conn, 0));
else
return p->plugin.flush != NULL;
}
@@ -314,12 +314,12 @@ plugin_is_rotational (struct backend *b, struct connection *conn)
{
struct backend_plugin *p = container_of (b, struct backend_plugin, backend);
- assert (connection_get_handle (conn));
+ assert (connection_get_handle (conn, 0));
debug ("is_rotational");
if (p->plugin.is_rotational)
-...
2018 Jan 19
0
[nbdkit PATCH v2 08/13] connections: Allow multiple handles to be stored in the connection object.
...get_handle (conn, 0));
debug ("can_flush");
if (p->plugin.can_flush)
- return p->plugin.can_flush (connection_get_handle (conn));
+ return p->plugin.can_flush (connection_get_handle (conn, 0));
else
return p->plugin.flush != NULL;
}
@@ -314,12 +314,12 @@ plugin_is_rotational (struct backend *b, struct connection *conn)
{
struct backend_plugin *p = container_of (b, struct backend_plugin, backend);
- assert (connection_get_handle (conn));
+ assert (connection_get_handle (conn, 0));
debug ("is_rotational");
if (p->plugin.is_rotational)
- ret...
2017 Feb 06
0
[PATCH 1/2] Define .errno_is_preserved constant instead of a .errno_is_reliable callback.
...extern void plugin_close (struct connection *conn);
extern int64_t plugin_get_size (struct connection *conn);
-extern int plugin_errno_is_reliable (struct connection *conn);
extern int plugin_can_write (struct connection *conn);
extern int plugin_can_flush (struct connection *conn);
extern int plugin_is_rotational (struct connection *conn);
diff --git a/src/plugins.c b/src/plugins.c
index 837a54f..eeed8a9 100644
--- a/src/plugins.c
+++ b/src/plugins.c
@@ -236,6 +236,7 @@ plugin_dump_fields (void)
break;
}
printf ("\n");
+ printf ("errno_is_preserved=%d\n", plugin.errno_is_pres...
2019 Aug 23
1
[nbdkit PATCH 1/3] server: Add internal support for NBDKIT_FLAG_FAST_ZERO
...if (fast_zero) {
+ assert (r == -1);
+ *err = EOPNOTSUPP;
+ goto done;
+ }
+
assert (p->plugin.pwrite || p->plugin._pwrite_old);
flags &= ~NBDKIT_FLAG_MAY_TRIM;
threadlocal_set_error (0);
@@ -762,6 +783,7 @@ static struct backend plugin_functions = {
.is_rotational = plugin_is_rotational,
.can_trim = plugin_can_trim,
.can_zero = plugin_can_zero,
+ .can_fast_zero = plugin_can_fast_zero,
.can_extents = plugin_can_extents,
.can_fua = plugin_can_fua,
.can_multi_conn = plugin_can_multi_conn,
diff --git a/server/protocol-handshake.c b/server/protocol-handshake.c
index 0f3...
2017 Jan 27
0
[nbdkit PATCH v3 1/4] plugins: Don't use bogus errno from non-C plugins
...extern void plugin_close (struct connection *conn);
extern int64_t plugin_get_size (struct connection *conn);
+extern int plugin_errno_is_reliable (struct connection *conn);
extern int plugin_can_write (struct connection *conn);
extern int plugin_can_flush (struct connection *conn);
extern int plugin_is_rotational (struct connection *conn);
diff --git a/src/plugins.c b/src/plugins.c
index 92f8505..d486f2d 100644
--- a/src/plugins.c
+++ b/src/plugins.c
@@ -395,6 +395,21 @@ plugin_get_size (struct connection *conn)
}
int
+plugin_errno_is_reliable (struct connection *conn)
+{
+ assert (dl);
+ assert (conn-...
2017 Feb 06
3
[PATCH nbdkit 0/2] Change .errno_is_reliable function to .errno_is_preserved constant.
See patch 1 for rationale.
2019 Aug 19
2
[nbdkit PATCH] noextents: Add hook to cripple SR advertisement
...SR. So this is hard-coded to true, with no exposure
+ * to the plugin interface; only filters can change it.
+ */
+ return 1;
+}
+
static int
plugin_can_extents (struct backend *b, struct connection *conn)
{
@@ -761,6 +772,7 @@ static struct backend plugin_functions = {
.is_rotational = plugin_is_rotational,
.can_trim = plugin_can_trim,
.can_zero = plugin_can_zero,
+ .can_sr = plugin_can_sr,
.can_extents = plugin_can_extents,
.can_fua = plugin_can_fua,
.can_multi_conn = plugin_can_multi_conn,
diff --git a/server/protocol-handshake-newstyle.c b/server/protocol-handshake-newstyle.c
index...
2019 Mar 12
0
[PATCH nbdkit] server: Implement extents/can_extents calls for plugins and filters.
...h = count;
+ (*extents)[0].type = NBDKIT_EXTENT_TYPE_DATA;
+ *nr_extents = 1;
+ return 0;
+ }
+}
+
static struct backend plugin_functions = {
.free = plugin_free,
.thread_model = plugin_thread_model,
@@ -672,6 +740,7 @@ static struct backend plugin_functions = {
.is_rotational = plugin_is_rotational,
.can_trim = plugin_can_trim,
.can_zero = plugin_can_zero,
+ .can_extents = plugin_can_extents,
.can_fua = plugin_can_fua,
.can_multi_conn = plugin_can_multi_conn,
.pread = plugin_pread,
@@ -679,6 +748,7 @@ static struct backend plugin_functions = {
.flush = plugin_flush,
.tri...
2016 Jan 11
1
[PATCH] Add support for newstyle NBD protocol (RHBZ#1297100).
Experimental and only very lightly tested so far.
Rich.
2018 Jan 17
14
[PATCH 0/9] Add filters to nbdkit.
The first three patches are identical to:
https://www.redhat.com/archives/libguestfs/2018-January/msg00079.html
"[PATCH nbdkit v2 0/3] Refactor plugin_* functions into a backend"
The rest of the patches add filters using the new filter API
previously described here:
https://www.redhat.com/archives/libguestfs/2018-January/msg00073.html
This needs a lot more testing -- and tests --