search for: normalize_bool

Displaying 4 results from an estimated 4 matches for "normalize_bool".

2020 Mar 17
0
[nbdkit PATCH 1/4] server: Normalize plugin can_* values
...3-2020 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -308,13 +308,21 @@ plugin_get_size (struct backend *b, void *handle) return p->plugin.get_size (handle); } +static int normalize_bool (int value) +{ + if (value == -1 || value == 0) + return value; + /* Normalize all other non-zero values to true */ + return 1; +} + static int plugin_can_write (struct backend *b, void *handle) { struct backend_plugin *p = container_of (b, struct backend_plugin, backend); if (p-&gt...
2020 Mar 17
1
Re: [nbdkit PATCH 1/4] server: Normalize plugin can_* values
...distribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions are > @@ -308,13 +308,21 @@ plugin_get_size (struct backend *b, void *handle) > return p->plugin.get_size (handle); > } > > +static int normalize_bool (int value) > +{ > + if (value == -1 || value == 0) > + return value; > + /* Normalize all other non-zero values to true */ > + return 1; > +} > + > static int > plugin_can_write (struct backend *b, void *handle) > { > struct backend_plugin *p = containe...
2020 Mar 17
9
[nbdkit PATCH 0/4] Fix testsuite hang with nbd-stadalone
Either patch 1 or patch 2 in isolation is sufficient to fix the problem that Rich forwarded on from an archlinux tester (name so I can credit them?). But both patches should be applied, as well as backported to appropriate stable branches, to maximize cross-version interoperability of nbdkit vs. plugins. Patch 3 will let us detect future similar bugs much faster. I want patch 4 to ensure that
2020 Mar 19
2
Re: [nbdkit PATCH 1/2] sh, eval: Cache .can_zero and .can_flush
On 3/18/20 8:21 PM, Eric Blake wrote: > In commit c306fa93ab and neighbors (v1.15.1), a concerted effort went > into caching the results of .can_FOO callbacks, with commit messages > demonstrating that a plugin with a slow callback should not have that > delay magnified multiple times. But nothing was added to the > testsuite at the time, and with the sh and eval plugins, we still