Displaying 5 results from an estimated 5 matches for "info_pread".
2019 Sep 28
0
[PATCH nbdkit v2 3/4] info: Add mode for sending back 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
info_pread (void *handle, void *buf, uint32_t count, uint64_t offset,
@@ -344,6 +423,10 @@ info_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_UPTIME || m...
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 28
0
[PATCH nbdkit v2 2/4] Rename nbdkit-reflection-plugin to nbdkit-info-plugin.
...eady 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, uint32_t count, uint64_t offset,
}
static struct nbdkit_plugin plugin = {
- .name = "ref...
2020 Feb 10
2
[nbdkit PATCH 04/10] plugins: Wire up in-memory plugin support for NBD_INFO_INIT_STATE
...+}
+
static void
update_time (struct handle *h)
{
@@ -444,6 +456,7 @@ static struct nbdkit_plugin plugin = {
.get_size = info_get_size,
.can_multi_conn = info_can_multi_conn,
.can_cache = info_can_cache,
+ .init_zero = info_init_zero,
.pread = info_pread,
/* In this plugin, errno is preserved properly along error return
* paths from failed system calls.
diff --git a/plugins/memory/memory.c b/plugins/memory/memory.c
index a96252b..bfc1249 100644
--- a/plugins/memory/memory.c
+++ b/plugins/memory/memory.c
@@ -101,6 +101,7 @@ memory_config_comp...
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