search for: seen_dirty

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

2019 Jun 04
0
[libnbd PATCH 2/2] api: Recover from block status callback failure
...callback */ +struct data { + bool req_one; /* input: true if req_one was passed to request */ + int count; /* input: count of expected remaining calls */ + bool fail; /* input: true to return failure */ + bool seen_base; /* output: true if base:allocation encountered */ + bool seen_dirty; /* output: true if qemu:dirty-bitmap encountered */ +}; static int -cb (void *data, const char *metacontext, uint64_t offset, +cb (void *opaque, const char *metacontext, uint64_t offset, uint32_t *entries, size_t len) { - /* Hack: data is non-NULL if request included REQ_ONE flag */ + st...
2019 Jun 04
3
[libnbd PATCH 0/2] Better handling of failed block_status callback
Rather than moving the connection to DEAD, we can just ignore further contexts to the existing command handle, and fail the overall command with the same errno as the failed callback. Eric Blake (2): states: Track cmd->error as errno, not wire value api: Recover from block status callback failure generator/generator | 5 ++- generator/states-reply-simple.c | 2 +-
2019 Jun 27
1
[libnbd PATCH] block-status: Make callback usage consistent with pread_structured
...errno = EPROTO; /* Something NBD servers can't send */ + /* Something NBD servers can't send */ + *error = data->count == 1 ? EPROTO : ECONNREFUSED; return -1; } return 0; @@ -147,17 +149,14 @@ main (int argc, char *argv[]) } assert (data.seen_base && data.seen_dirty); - /* Trigger a failed callback, to prove connection stays up. No way - * to know which context will respond first, but we can check that - * the other one did not get visited. - */ - data = (struct data) { .count = 1, .fail = true, }; + /* Trigger a failed callback, to prove connection...
2019 Jul 16
1
[libnbd PATCH] generator: Prefer closure opaque after function pointer in C
...data) { .count = 2, }; - if (nbd_block_status (nbd, exportsize, 0, &data, cb, 0) == -1) { + if (nbd_block_status (nbd, exportsize, 0, cb, &data, 0) == -1) { fprintf (stderr, "%s\n", nbd_get_error ()); exit (EXIT_FAILURE); } assert (data.seen_base && data.seen_dirty); data = (struct data) { .req_one = true, .count = 2, }; - if (nbd_block_status (nbd, exportsize, 0, &data, cb, + if (nbd_block_status (nbd, exportsize, 0, cb, &data, LIBNBD_CMD_FLAG_REQ_ONE) == -1) { fprintf (stderr, "%s\n", nbd_get_error ());...
2019 Aug 13
0
[PATCH libnbd 1/4] api: Combine callback and user_data into a single struct.
...(nbd_block_status (nbd, exportsize, 0, + (nbd_extent_callback) { .callback = cb, .user_data = &data }, + 0) == -1) { fprintf (stderr, "%s\n", nbd_get_error ()); exit (EXIT_FAILURE); } assert (data.seen_base && data.seen_dirty); data = (struct data) { .req_one = true, .count = 2, }; - if (nbd_block_status (nbd, exportsize, 0, cb, &data, + if (nbd_block_status (nbd, exportsize, 0, + (nbd_extent_callback) { .callback = cb, .user_data = &data }, LIBNBD_CMD_FLAG_...
2019 Aug 13
8
[PATCH libnbd 0/4] Add free function to callbacks.
Patches 1 & 2 are rather complex, but the end result is that we pass closures + user_data + free function in single struct parameters as I described previously in this email: https://www.redhat.com/archives/libguestfs/2019-August/msg00210.html Patch 3 adds a convenient FREE_CALLBACK macro which seems a worthwhile simplification if you buy into 1 & 2. Patch 4 adds another macro which is