search for: boolean_method

Displaying 17 results from an estimated 17 matches for "boolean_method".

2019 Aug 23
2
[nbdkit PATCH 3/3] plugins: Add .can_fast_zero hook
...lags & NBDKIT_FLAG_FAST_ZERO) + flag_append("fast", &comma, &buf, &len); } static void @@ -536,7 +539,7 @@ sh_pwrite (void *handle, const void *buf, uint32_t count, uint64_t offset, /* Common code for handling all boolean methods like can_write etc. */ static int -boolean_method (void *handle, const char *method_name) +boolean_method (void *handle, const char *method_name, int def) { char *h = handle; const char *args[] = { script, method_name, h, NULL }; @@ -546,8 +549,8 @@ boolean_method (void *handle, const char *method_name) return 1; case RET_FALSE:...
2020 Mar 19
0
[nbdkit PATCH 1/2] sh, eval: Cache .can_zero and .can_flush
...st char *args[] = { script, method, h, cbuf, obuf, fbuf, NULL }; + const char *args[] = { script, method, h->h, cbuf, obuf, fbuf, NULL }; snprintf (cbuf, sizeof cbuf, "%" PRIu32, count); snprintf (obuf, sizeof obuf, "%" PRIu64, offset); @@ -429,8 +445,8 @@ static int boolean_method (const char *script, const char *method, void *handle, int def) { - char *h = handle; - const char *args[] = { script, method, h, NULL }; + struct sh_handle *h = handle; + const char *args[] = { script, method, h->h, NULL }; switch (call (args)) { case OK:...
2018 Dec 14
0
[PATCH nbdkit 2/3] sh: Switch nbdkit-sh-plugin to use API version 2.
...ot;fua" : ""; + const char *args[] = { script, "pwrite", h, cbuf, obuf, sflags, NULL }; snprintf (cbuf, sizeof cbuf, "%" PRIu32, count); snprintf (obuf, sizeof obuf, "%" PRIu64, offset); @@ -467,12 +472,6 @@ sh_can_flush (void *handle) return boolean_method (handle, "can_flush"); } -static int -sh_can_trim (void *handle) -{ - return boolean_method (handle, "can_trim"); -} - static int sh_is_rotational (void *handle) { @@ -480,7 +479,70 @@ sh_is_rotational (void *handle) } static int -sh_flush (void *handle) +sh_can_trim...
2018 Dec 15
0
[PATCH nbdkit v2 3/4] sh: Switch nbdkit-sh-plugin to use API version 2.
...uf, NULL }; snprintf (cbuf, sizeof cbuf, "%" PRIu32, count); snprintf (obuf, sizeof obuf, "%" PRIu64, offset); + flags_string (flags, fbuf, sizeof fbuf); switch (call_write (buf, count, args)) { case OK: @@ -467,12 +508,6 @@ sh_can_flush (void *handle) return boolean_method (handle, "can_flush"); } -static int -sh_can_trim (void *handle) -{ - return boolean_method (handle, "can_trim"); -} - static int sh_is_rotational (void *handle) { @@ -480,7 +515,70 @@ sh_is_rotational (void *handle) } static int -sh_flush (void *handle) +sh_can_trim...
2020 Mar 19
2
Re: [nbdkit PATCH 1/2] sh, eval: Cache .can_zero and .can_flush
...ixes: 05c5eed6f2 > Fixes: 8490694d08 > Signed-off-by: Eric Blake <eblake@redhat.com> > --- > @@ -457,8 +473,14 @@ int > sh_can_flush (void *handle) > { > const char *method = "can_flush"; > - const char *script = get_script (method); > - return boolean_method (script, method, handle, 0); > + const char *script; > + struct sh_handle *h = handle; > + > + if (h->can_flush >= 0) > + return h->can_flush; > + > + script = get_script (method); > + return h->can_flush = boolean_method (script, method, handle, 0); >...
2020 Mar 19
5
[nbdkit PATCH 0/2] More caching of initial setup
When I added .can_FOO caching in 1.16, I missed the case that the sh plugin itself was calling .can_flush twice in some situations (in order to default .can_fua). Then right after, I regressed it to call .can_zero twice (in order to default .can_fast_zero). I also missed that .thread_model could use better caching, because at the time, I did not add testsuite coverage. Fix that now. Eric Blake
2019 May 10
0
[nbdkit PATCH 6/9] sh: Implement .cache script callback
...o provide a C<can_cache> method which exits with code C<0> (true). + =back =head2 Missing callbacks diff --git a/plugins/sh/sh.c b/plugins/sh/sh.c index a5beb57..7aded44 100644 --- a/plugins/sh/sh.c +++ b/plugins/sh/sh.c @@ -578,6 +578,12 @@ sh_can_multi_conn (void *handle) return boolean_method (handle, "can_multi_conn"); } +static int +sh_can_cache (void *handle) +{ + return boolean_method (handle, "can_cache"); +} + static int sh_flush (void *handle, uint32_t flags) { @@ -782,6 +788,38 @@ sh_extents (void *handle, uint32_t count, uint64_t offset, uint32_t flags...
2018 Dec 15
5
[PATCH nbdkit v2 0/4] tests: Test export flags (eflags).
v1 was here: https://www.redhat.com/archives/libguestfs/2018-December/thread.html#00123 v2: - Document "-" instead of "script=-" and use it in the test; and verify this also works on FreeBSD; and verify that it doesn't depend on the particular behaviour of our wrapper script and should work with installed nbdkit too. - Fix handling of zero flags parameter. -
2019 Aug 23
22
cross-project patches: Add NBD Fast Zero support
This is a cover letter to a series of patches being proposed in tandem to four different projects: - nbd: Document a new NBD_CMD_FLAG_FAST_ZERO command flag - qemu: Implement the flag for both clients and server - libnbd: Implement the flag for clients - nbdkit: Implement the flag for servers, including the nbd passthrough client If you want to test the patches together, I've pushed a
2018 Dec 14
6
[PATCH nbdkit 0/3] tests: Test export flags (eflags).
Some feature additions to the shell script plugin allow us to test the export flags field reasonably easily. Rich.
2006 Jul 16
1
form helpers with non-ActiveRecord objects
I have an ActiveRecord model (called Festival) that contains an array of "FestDate" objects serialized into a sql text column of the Festival object. (like the Agile book first edition describes on p. 205) The FestDate objects themselvs are not ActiveRecord objects. (of course, otherwise they would be in their own table...) When working with a Festival, I would like to use various
2019 May 16
0
[nbdkit PATCH v2 07/24] sh: Implement .cache script callback
...4 @@ Richard W.M. Jones =head1 COPYRIGHT -Copyright (C) 2018 Red Hat Inc. +Copyright (C) 2018-2019 Red Hat Inc. diff --git a/plugins/sh/sh.c b/plugins/sh/sh.c index a5beb57..862be21 100644 --- a/plugins/sh/sh.c +++ b/plugins/sh/sh.c @@ -578,6 +578,53 @@ sh_can_multi_conn (void *handle) return boolean_method (handle, "can_multi_conn"); } +/* Not a boolean method, the method prints "none", "emulate" or "native". */ +static int +sh_can_cache (void *handle) +{ + char *h = handle; + const char *args[] = { script, "can_cache", h, NULL }; + CLEANUP_FREE...
2019 May 10
11
[nbdkit PATCH 0/9] RFC: implement NBD_CMD_CACHE
I'm still working my way through the filters before this series will be complete, but this is enough of a start to at least get some feedback on the idea of implementing another NBD protocol extension. Eric Blake (9): server: Internal hooks for implementing NBD_CMD_CACHE plugins: Add .cache callback file, split: Implement .cache with posix_fadvise nbd: Implement NBD_CMD_CACHE
2019 Jan 04
10
[PATCH nbdkit 0/7] server: Implement NBD_FLAG_CAN_MULTI_CONN.
First thing to say is that I need to do a *lot* more testing on this, so this is just an early peek. In particular, although it passed ‘make check && make check-valgrind’ I have *not* tested it against a multi-conn-aware client such as the Linux kernel >= 4.9. This implements NBD_FLAG_CAN_MULTI_CONN, described in the protocol doc as: "NBD_FLAG_CAN_MULTI_CONN: Indicates that
2019 Jan 05
15
[PATCH nbdkit v2 01/11] server: Implement NBD_FLAG_CAN_MULTI_CONN.
For existing commits, this is almost identical to v1, except that I updated some commit messages and reordered the commits in a somewhat more logical sequence. The main changes are the extra commits: [06/11] plugins: Return NBD_FLAG_CAN_MULTI_CONN from some readonly plugins. - Readonly plugins that can set the flag unconditionally. [09/11] partitioning: Return NBD_FLAG_CAN_MULTI_CONN. [10/11]
2020 Feb 10
17
Cross-project NBD extension proposal: NBD_INFO_INIT_STATE
I will be following up to this email with four separate threads each addressed to the appropriate single list, with proposed changes to: - the NBD protocol - qemu: both server and client - libnbd: client - nbdkit: server The feature in question adds a new optional NBD_INFO_ packet to the NBD_OPT_GO portion of handshake, adding up to 16 bits of information that the server can advertise to the
2019 May 16
27
[nbdkit PATCH v2 00/24] implement NBD_CMD_CACHE
Since v1: - rework .can_cache to be tri-state, with default of no advertisement (ripple effect through other patches) - add a lot more patches in order to round out filter support And in the meantime, Rich pushed NBD_CMD_CACHE support into libnbd, so in theory we now have a way to test cache commands through the entire stack. Eric Blake (24): server: Internal hooks for implementing