Displaying 20 results from an estimated 162 matches for "is_rotational".
2019 Nov 22
1
Re: [PATCH nbdkit v2 05/10] python: Share common code in boolean callbacks.
...fd4dcb 100644
> --- a/plugins/python/nbdkit-python-plugin.pod
> +++ b/plugins/python/nbdkit-python-plugin.pod
> @@ -184,25 +184,25 @@ contents will be garbage collected.
> def get_size(h):
> # return the size of the disk
>
> -=item C<can_write>
> +=item C<is_rotational>
>
> (Optional)
>
> - def can_write(h):
> + def is_rotational(h):
> # return a boolean
>
> -=item C<can_flush>
> +=item C<can_write>
>
> (Optional)
>
> - def can_flush(h):
> + def can_write(h):
> # return a boo...
2019 Nov 22
0
[PATCH nbdkit v2 05/10] python: Share common code in boolean callbacks.
...n/nbdkit-python-plugin.pod
index 51e0f57..0fd4dcb 100644
--- a/plugins/python/nbdkit-python-plugin.pod
+++ b/plugins/python/nbdkit-python-plugin.pod
@@ -184,25 +184,25 @@ contents will be garbage collected.
def get_size(h):
# return the size of the disk
-=item C<can_write>
+=item C<is_rotational>
(Optional)
- def can_write(h):
+ def is_rotational(h):
# return a boolean
-=item C<can_flush>
+=item C<can_write>
(Optional)
- def can_flush(h):
+ def can_write(h):
# return a boolean
-=item C<is_rotational>
+=item C<can_flush>
(Optional)
- def...
2019 Nov 22
3
Re: [PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
...omplete ():
> + print ("set_error = %r" % nbdkit.set_error)
> +
> +def open (readonly):
> + return {
> + 'disk': bytearray (cfg.get ('size', 0))
> + }
> +
> +def get_size (h):
> + return len (h['disk'])
> +
> +def is_rotational(h):
> + return cfg.get ('is_rotational', False)
> +
> +def can_multi_conn (h):
> + return cfg.get ('can_multi_conn', False)
> +
> +def can_write (h):
> + return cfg.get ('can_write', True)
> +
> +def can_flush(h):
> + return cfg.get...
2017 Nov 15
1
[nbdkit PATCH] connections: Extract common export flag computation code
...;
+ 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;
+...
2020 Oct 02
0
[libnbd PATCH v2 2/2] info: List available meta-contexts
...err, "%s\n", nbd_get_error ());
@@ -387,7 +422,6 @@ list_one_export (struct nbd_handle *nbd, const char *desc,
/* Get description if list didn't already give us one */
if (!desc)
desc = export_desc = nbd_get_export_description (nbd);
- content = get_content (nbd, size);
is_rotational = nbd_is_rotational (nbd);
is_read_only = nbd_is_read_only (nbd);
can_cache = nbd_can_cache (nbd);
@@ -401,6 +435,12 @@ list_one_export (struct nbd_handle *nbd, const char *desc,
block_minimum = nbd_get_block_size (nbd, LIBNBD_SIZE_MINIMUM);
block_preferred = nbd_get_block_size (nbd, LI...
2019 Nov 22
18
[PATCH nbdkit v2 00/10] Implement nbdkit API v2 for Python plugins.
v1:
https://www.redhat.com/archives/libguestfs/2019-November/msg00153.html
v2:
- Fix implementation of can_cache.
- Add implementation of can_fua.
- Add a very thorough test suite which tests every command + flag
combination.
2019 Jan 01
2
[PATCH nbdkit] server: Use bool for types which are really booleans.
...sockout);
diff --git a/server/connections.c b/server/connections.c
index 0d1bd74..0a89315 100644
--- a/server/connections.c
+++ b/server/connections.c
@@ -78,13 +78,13 @@ struct connection {
uint32_t cflags;
uint64_t exportsize;
uint16_t eflags;
- int readonly;
- int can_flush;
- int is_rotational;
- int can_trim;
- int can_zero;
- int can_fua;
- int using_tls;
+ bool readonly;
+ bool can_flush;
+ bool is_rotational;
+ bool can_trim;
+ bool can_zero;
+ bool can_fua;
+ bool using_tls;
int sockin, sockout;
connection_recv_function recv;
@@ -419,7 +419,7 @@ compute_eflags (st...
2019 Nov 22
0
[PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
...ecode (v.encode(), "base64"))
+
+def config_complete ():
+ print ("set_error = %r" % nbdkit.set_error)
+
+def open (readonly):
+ return {
+ 'disk': bytearray (cfg.get ('size', 0))
+ }
+
+def get_size (h):
+ return len (h['disk'])
+
+def is_rotational(h):
+ return cfg.get ('is_rotational', False)
+
+def can_multi_conn (h):
+ return cfg.get ('can_multi_conn', False)
+
+def can_write (h):
+ return cfg.get ('can_write', True)
+
+def can_flush(h):
+ return cfg.get ('can_flush', False)
+
+def can_trim(h):
+...
2019 Nov 21
10
[PATCH nbdkit 0/8] Implement nbdkit API v2 for Python plugins.
And fill out most of the missing bits of the API.
Rich.
2019 Aug 30
0
[nbdkit PATCH 6/9] server: Cache per-connection can_FOO flags
...e> and other data serving callbacks
diff --git a/server/internal.h b/server/internal.h
index ec8a894c..ddb79623 100644
--- a/server/internal.h
+++ b/server/internal.h
@@ -152,6 +152,15 @@ struct b_conn_handle {
void *handle;
uint64_t exportsize;
+ int can_write;
+ int can_flush;
+ int is_rotational;
+ int can_trim;
+ int can_zero;
+ int can_fua;
+ int can_multi_conn;
+ int can_cache;
+ int can_extents;
};
struct connection {
@@ -169,16 +178,6 @@ struct connection {
uint32_t cflags;
uint16_t eflags;
- bool readonly;
- bool can_flush;
- bool is_rotational;
- bool can_trim;
-...
2020 Oct 06
2
[PATCH libnbd] info: Write output atomically.
...- printf ("\tcontexts:\n");
+ fprintf (fp, "\tcontexts:\n");
for (struct context_list *next = contexts; next; next = next->next)
- printf ("\t\t%s\n", next->name);
+ fprintf (fp, "\t\t%s\n", next->name);
}
if (is_rotational >= 0)
- printf ("\t%s: %s\n", "is_rotational", is_rotational ? "true" : "false");
+ fprintf (fp, "\t%s: %s\n", "is_rotational",
+ is_rotational ? "true" : "false");
if (is_read_only >=...
2020 Mar 17
0
[nbdkit PATCH 1/4] server: Normalize plugin can_* values
...nd_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...
2018 Aug 01
0
[PATCH v2 nbdkit 3/6] filters: Print filter name in debugging messages.
...backend.i);
struct b_conn nxdata = { .b = f->backend.next, .conn = conn };
- debug ("can_flush");
+ debug ("%s: can_flush", f->name);
if (f->filter.can_flush)
return f->filter.can_flush (&next_ops, &nxdata, handle);
@@ -451,7 +451,7 @@ filter_is_rotational (struct backend *b, struct connection *conn)
void *handle = connection_get_handle (conn, f->backend.i);
struct b_conn nxdata = { .b = f->backend.next, .conn = conn };
- debug ("is_rotational");
+ debug ("%s: is_rotational", f->name);
if (f->filter.is_r...
2020 Sep 21
0
[nbdkit PATCH v3 06/14] api: Add .export_description
...t = cc_preconnect,
+ .list_exports = cc_list_exports,
+ .default_export = cc_default_export,
+ .open = cc_open,
+ .close = cc_close,
- .get_size = cc_get_size,
- .can_write = cc_can_write,
- .can_flush = cc_can_flush,
- .is_rotational = cc_is_rotational,
- .can_trim = cc_can_trim,
- .can_zero = cc_can_zero,
- .can_fast_zero = cc_can_fast_zero,
- .can_extents = cc_can_extents,
- .can_fua = cc_can_fua,
- .can_multi_conn = cc_can_multi_conn,
- .can_cache = cc_can_cache,
+...
2018 Jan 17
0
[PATCH 5/9] connections: Allow multiple handles to be stored in the connection object.
...e (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)
-...
2020 Feb 27
3
[PATCH nbdkit] server: When using --run, wait for captive nbdkit to exit.
I'd like to propose we backport this to 1.18 and some earlier stable
branches too.
Rich.
2018 Jan 19
0
[nbdkit PATCH v2 08/13] connections: Allow multiple handles to be stored in the connection object.
...dle (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...
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)...
2020 Mar 17
1
Re: [nbdkit PATCH 1/4] server: Normalize plugin can_* values
...ackend_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 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)...