search for: reflection_can_cache

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

2019 Sep 28
0
[PATCH nbdkit v2 2/4] Rename nbdkit-reflection-plugin to nbdkit-info-plugin.
..._get_size (void *handle) } static int -reflection_can_multi_conn (void *handle) +info_can_multi_conn (void *handle) { switch (mode) { /* Safe for exportname modes since clients should only request @@ -329,7 +329,7 @@ reflection_can_multi_conn (void *handle) /* Cache. */ 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 *b...
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 15
0
[PATCH nbdkit 1/4] Add reflection plugin.
...+ +/* Get the disk size. */ +static int64_t +reflection_get_size (void *handle) +{ + struct handle *h = handle; + + return (int64_t) h->len; +} + +/* Read-only plugin so multi-conn is safe. */ +static int +reflection_can_multi_conn (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, +...
2019 Sep 28
0
[PATCH nbdkit 2/2] reflection: Add mode for reflecting server time.
...e MODE_ADDRESS: return 0; + /* All time modes will read different values at different times, + * so all of them are unsafe for multi-conn. + */ + case MODE_TIME: + case MODE_UPTIME: + case MODE_CONNTIME: + return 0; /* Keep GCC happy. */ default: @@ -337,6 +380,42 @@ reflection_can_cache (void *handle) return NBDKIT_CACHE_NATIVE; } +static void +update_time (struct handle *h) +{ + struct timeval tv; + int64_t secs; + int32_t usecs; + char *p; + + gettimeofday (&tv, NULL); + + switch (mode) { + case MODE_TIME: + break; + + case MODE_UPTIME: + subtract_timeval...
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