search for: reflection_pread

Displaying 6 results from an estimated 6 matches for "reflection_pread".

2019 Sep 28
2
[PATCH nbdkit 1/2] common/include: Add function for subtracting struct timeval.
--- common/include/test-tvdiff.c | 75 +++++++++++++++++++++++++++++------- common/include/tvdiff.h | 13 ++++++- 2 files changed, 74 insertions(+), 14 deletions(-) diff --git a/common/include/test-tvdiff.c b/common/include/test-tvdiff.c index 9cbcfc0..abefb2e 100644 --- a/common/include/test-tvdiff.c +++ b/common/include/test-tvdiff.c @@ -36,7 +36,6 @@ #include <stdlib.h> #include
2019 Sep 28
0
[PATCH nbdkit 2/2] reflection: Add mode for reflecting server time.
...+ abort (); + } + + /* Pack the result into the output buffer. */ + secs = tv.tv_sec; + usecs = tv.tv_usec; + secs = htobe64 (secs); + usecs = htobe32 (usecs); + p = h->data; + memcpy (&p[0], &secs, 8); + memcpy (&p[8], &usecs, 4); +} + /* Read data. */ static int reflection_pread (void *handle, void *buf, uint32_t count, uint64_t offset, @@ -344,6 +423,10 @@ reflection_pread (void *handle, void *buf, uint32_t count, uint64_t offset, { struct handle *h = handle; + /* For the time modes we update the data on every read. */ + if (mode == MODE_TIME || mode == MODE_UPTIM...
2019 Sep 28
0
[PATCH nbdkit v2 2/4] Rename nbdkit-reflection-plugin to nbdkit-info-plugin.
...e. */ static int -reflection_can_cache (void *handle) +info_can_cache (void *handle) { /* Everything is already in memory, returning this without * implementing .cache lets nbdkit do the correct no-op. @@ -339,8 +339,8 @@ reflection_can_cache (void *handle) /* Read data. */ static int -reflection_pread (void *handle, void *buf, uint32_t count, uint64_t offset, - uint32_t flags) +info_pread (void *handle, void *buf, uint32_t count, uint64_t offset, + uint32_t flags) { struct handle *h = handle; @@ -349,18 +349,18 @@ reflection_pread (void *handle, void *buf, uint3...
2019 Sep 15
0
[PATCH nbdkit 1/4] Add reflection plugin.
...n (void *handle) +{ + return 1; +} + +/* Cache. */ +static int +reflection_can_cache (void *handle) +{ + /* Everything is already in memory, returning this without + * implementing .cache lets nbdkit do the correct no-op. + */ + return NBDKIT_CACHE_NATIVE; +} + +/* Read data. */ +static int +reflection_pread (void *handle, void *buf, uint32_t count, uint64_t offset, + uint32_t flags) +{ + struct handle *h = handle; + + memcpy (buf, h->data + offset, count); + return 0; +} + +static struct nbdkit_plugin plugin = { + .name = "reflection", + .version...
2019 Sep 28
9
[PATCH nbdkit v2 0/4] info: Add mode for sending back server time.
v1 was: https://www.redhat.com/archives/libguestfs/2019-September/thread.html#00361 v2: - Adds a patch to rename the reflection plugin to the info plugin. - Adds tests. Rich.
2019 Sep 15
13
[PATCH nbdkit 0/4] Reflection plugin, peer name.
This series is based on my blog posting here: https://rwmj.wordpress.com/2019/09/13/nbdkit-supports-exportnames/ It depends on the fix for realloc: https://www.redhat.com/archives/libguestfs/2019-September/thread.html#00103 This series adds a fun plugin, and also an semi-related feature I've long thought to be desirable. You can consider patches 1 & 4, and patches 2 & 3 as forming