search for: msg00171

Displaying 12 results from an estimated 12 matches for "msg00171".

Did you mean: msg00176
2018 Aug 01
2
Re: [PATCH v2 nbdkit 4/6] common: Add a directory for common code shared by plugins and filters.
...+#define NBDKIT_ISZERO_H > + > +#include <string.h> > +#include <stdbool.h> > + > +/* Return true iff the buffer is all zero bytes. > + * > + * The clever approach here was suggested by Eric Blake. See: > + * https://www.redhat.com/archives/libguestfs/2017-April/msg00171.html It would be nice to mention the original author: http://rusty.ozlabs.org/?p=560 > > + */ > +static inline bool > +is_zero (const char *buffer, size_t size) > +{ > + size_t i; > + const size_t limit = size < 16 ? size : 16; > + > + for (i = 0; i < limit;...
2017 Oct 12
1
Re: [PATCH miniexpect 2/2] Add debugging capability at runtime.
On Wednesday, 11 October 2017 17:23:45 CEST Richard W.M. Jones wrote: > +static int > +mexp_vprintf (mexp_h *h, int password, const char *fs, va_list args) > { > - va_list args; > char *msg; > int len; > size_t n; > ssize_t r; > char *p; > > - va_start (args, fs); > len = vasprintf (&msg, fs, args); > - va_end (args); Due to the
2009 Nov 20
6
[PATCH 0/6] Simple fixes for cross-compiling the daemon
As outlined here: https://www.redhat.com/archives/libguestfs/2009-November/msg00171.html These patches fix some of the simpler things. Some of the things (the missing headers) are genuine bugs. Note in order to cross-compile at all you have to comment out the section in the daemon/configure.ac where it detects custom format specifiers. Rich. -- Richard Jones, Virtualization...
2018 Aug 01
0
[PATCH v2 nbdkit 4/6] common: Add a directory for common code shared by plugins and filters.
...DAMAGE. + */ + +#ifndef NBDKIT_ISZERO_H +#define NBDKIT_ISZERO_H + +#include <string.h> +#include <stdbool.h> + +/* Return true iff the buffer is all zero bytes. + * + * The clever approach here was suggested by Eric Blake. See: + * https://www.redhat.com/archives/libguestfs/2017-April/msg00171.html + */ +static inline bool +is_zero (const char *buffer, size_t size) +{ + size_t i; + const size_t limit = size < 16 ? size : 16; + + for (i = 0; i < limit; ++i) + if (buffer[i]) + return false; + if (size != limit) + return ! memcmp (buffer, buffer + 16, size - 16); + + r...
2018 Aug 01
0
Re: [PATCH v2 nbdkit 4/6] common: Add a directory for common code shared by plugins and filters.
...; > +#include <string.h> > > +#include <stdbool.h> > > + > > +/* Return true iff the buffer is all zero bytes. > > + * > > + * The clever approach here was suggested by Eric Blake. See: > > + * https://www.redhat.com/archives/libguestfs/2017-April/msg00171.html > > > It would be nice to mention the original author: > http://rusty.ozlabs.org/?p=560 Thanks - I didn't know that. I will add the link to the comment. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtual...
2019 Jan 01
0
[PATCH nbdkit v2 1/4] common/bitmap: Add bitmap_next function and tests.
...P_H */ diff --git a/common/include/iszero.h b/common/include/iszero.h index 1079f3e..7a54f0a 100644 --- a/common/include/iszero.h +++ b/common/include/iszero.h @@ -42,6 +42,9 @@ * The clever approach here was suggested by Eric Blake. See: * https://www.redhat.com/archives/libguestfs/2017-April/msg00171.html * https://rusty.ozlabs.org/?p=560 + * + * See also: + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69908 */ static inline bool is_zero (const char *buffer, size_t size) diff --git a/common/include/nextnonzero.h b/common/include/nextnonzero.h new file mode 100644 index 0000000..3f96e85...
2020 Jan 30
2
[PATCH libnbd] python: Add AIO buffer is_zero method.
...DAMAGE. + */ + +#ifndef NBDKIT_ISZERO_H +#define NBDKIT_ISZERO_H + +#include <string.h> +#include <stdbool.h> + +/* Return true iff the buffer is all zero bytes. + * + * The clever approach here was suggested by Eric Blake. See: + * https://www.redhat.com/archives/libguestfs/2017-April/msg00171.html + * https://rusty.ozlabs.org/?p=560 + * + * See also: + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69908 + */ +static inline bool __attribute__((__nonnull__ (1))) +is_zero (const char *buffer, size_t size) +{ + size_t i; + const size_t limit = size < 16 ? size : 16; + + for (i = 0; i...
2018 Jul 31
0
[PATCH nbdkit 1/4] Add truncate filter for truncating or extending the size of plugins.
...return -1; + count -= n; + buf += n; + } + + if (count > 0) + memset (buf, 0, count); + + return 0; +} + +/* Return true iff the buffer is all zero bytes. + * + * The clever approach here was suggested by Eric Blake. See: + * https://www.redhat.com/archives/libguestfs/2017-April/msg00171.html + */ +static inline int +is_zero (const char *buffer, size_t size) +{ + size_t i; + const size_t limit = size < 16 ? size : 16; + + for (i = 0; i < limit; ++i) + if (buffer[i]) + return 0; + if (size != limit) + return !memcmp (buffer, buffer + 16, size - 16); + + return...
2018 Aug 01
12
[PATCH v2 nbdkit 0/6] Add truncate filter and other fixes.
I have dropped the map filter from this series for now while I try to get it working. However I think the truncate filter is in a good shape. This incorporates all feedback from Eric's review. Also there are three small fixes to the filter code, all revealed when I was testing using multiple filters which we'd not done much of before. Rich.
2018 Jul 31
7
[PATCH nbdkit 0/4] Add truncate and map filters.
This patch series proposes two new filters. * truncate: This can truncate, extend, round up or round down the size of a plugin/device. A typical usage is to fix the qemu problem that it can only handle devices which are a multiple of 512-bytes: nbdkit --filter=truncate random size=500 round-up=512 This will serve a virtual device with size 512 bytes. Reading from the last 12 bytes will
2019 Jan 01
7
[PATCH nbdkit v2 0/4] cache: Implement cache-max-size etc.
These are essentially identical to what was previously posted as patches 6/9 through 9/9 here: https://www.redhat.com/archives/libguestfs/2018-December/msg00145.html except that it has been rebased onto the current git master and retested thoroughly. Rich.
2018 Dec 28
12
[PATCH nbdkit 0/9] cache: Implement cache-max-size and method of reclaiming space from the cache.
This patch series enhances the cache filter in a few ways, primarily adding a "cache-on-read" feature (similar to qemu's copyonread); and adding the ability to limit the cache size and the antecedent of that which is having a method to reclaim cache blocks. As the cache is stored as a sparse temporary file, reclaiming cache blocks simply means punching holes in the temporary file.