Displaying 3 results from an estimated 3 matches for "info_open".
2019 Sep 28
0
[PATCH nbdkit v2 2/4] Rename nbdkit-reflection-plugin to nbdkit-info-plugin.
...{
#ifdef HAVE_BASE64
- printf ("reflection_base64=yes\n");
+ printf ("info_base64=yes\n");
#endif
}
@@ -228,7 +228,7 @@ handle_address (struct sockaddr *sa, socklen_t addrlen,
* - Leaking host information (eg. paths).
*/
static void *
-reflection_open (int readonly)
+info_open (int readonly)
{
const char *export_name;
size_t export_name_len;
@@ -286,7 +286,7 @@ reflection_open (int readonly)
/* Close the per-connection handle. */
static void
-reflection_close (void *handle)
+info_close (void *handle)
{
struct handle *h = handle;
@@ -298,7 +298,7 @@ refle...
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 3/4] info: Add mode for sending back server time.
...void
@@ -105,6 +127,7 @@ info_dump_plugin (void)
struct handle {
void *data; /* Block device data. */
size_t len; /* Length of data in bytes. */
+ struct timeval conn_t; /* Time since connection was opened. */
};
static int
@@ -279,6 +302,19 @@ info_open (int readonly)
}
return h;
+ case MODE_TIME:
+ case MODE_UPTIME:
+ case MODE_CONNTIME:
+ gettimeofday (&h->conn_t, NULL);
+ h->len = 12;
+ h->data = malloc (h->len);
+ if (h->data == NULL) {
+ nbdkit_error ("malloc: %m");
+ free (h);...