search for: check_ext

Displaying 20 results from an estimated 22 matches for "check_ext".

Did you mean: checknext
2019 May 28
0
[libnbd PATCH 2/4] api: Rearrange flags argument to block_status
...tests/meta-base-allocation.c index 5c37e45..ce344d7 100644 --- a/tests/meta-base-allocation.c +++ b/tests/meta-base-allocation.c @@ -98,22 +98,20 @@ main (int argc, char *argv[]) /* Read the block status. */ id = 1; - if (nbd_block_status (nbd, 65536, 0, 0, &id, - check_extent) == -1) { + if (nbd_block_status (nbd, 65536, 0, &id, check_extent, 0) == -1) { fprintf (stderr, "%s\n", nbd_get_error ()); exit (EXIT_FAILURE); } id = 2; - if (nbd_block_status (nbd, 1024, 32768-512, 0, &id, - check_extent) == -1) { +...
2019 Jul 16
1
[libnbd PATCH] generator: Prefer closure opaque after function pointer in C
.../meta-base-allocation.c b/tests/meta-base-allocation.c index 9b3ad1f..95e029b 100644 --- a/tests/meta-base-allocation.c +++ b/tests/meta-base-allocation.c @@ -100,19 +100,19 @@ main (int argc, char *argv[]) /* Read the block status. */ id = 1; - if (nbd_block_status (nbd, 65536, 0, &id, check_extent, 0) == -1) { + if (nbd_block_status (nbd, 65536, 0, check_extent, &id, 0) == -1) { fprintf (stderr, "%s\n", nbd_get_error ()); exit (EXIT_FAILURE); } id = 2; - if (nbd_block_status (nbd, 1024, 32768-512, &id, check_extent, 0) == -1) { + if (nbd_block_status...
2019 Jun 04
0
[PATCH libnbd v2 2/4] generator: Callback returns int instead of void.
...struct command_in_flight { struct command_in_flight *next; diff --git a/tests/meta-base-allocation.c b/tests/meta-base-allocation.c index 71f2afc..b00aa50 100644 --- a/tests/meta-base-allocation.c +++ b/tests/meta-base-allocation.c @@ -28,9 +28,9 @@ #include <libnbd.h> -static void check_extent (void *data, const char *metacontext, - uint64_t offset, - uint32_t *entries, size_t nr_entries); +static int check_extent (void *data, const char *metacontext, + uint64_t offset, + uint32_t *entrie...
2019 Aug 12
0
[PATCH libnbd 7/7] api: Remove the valid_flag from all callbacks.
...assert (completion_cb_freed == 1); exit (EXIT_SUCCESS); } diff --git a/tests/meta-base-allocation.c b/tests/meta-base-allocation.c index c36a77f..0219ce9 100644 --- a/tests/meta-base-allocation.c +++ b/tests/meta-base-allocation.c @@ -30,7 +30,7 @@ #include <libnbd.h> -static int check_extent (unsigned valid_flag, void *data, +static int check_extent (void *data, const char *metacontext, uint64_t offset, uint32_t *entries, size_t nr_entries, int *error); @@ -129,7 +129,7 @@ main (int argc, char *argv[]) }...
2019 Jun 27
0
Re: [libnbd PATCH] generator: Add support for namespace constants
...argv[]) exit (EXIT_FAILURE); } - switch (nbd_can_meta_context (nbd, "base:allocation")) { + switch (nbd_can_meta_context (nbd, LIBNBD_CONTEXT_BASE_ALLOCATION)) { case -1: fprintf (stderr, "%s\n", nbd_get_error ()); exit (EXIT_FAILURE); @@ -137,7 +137,7 @@ check_extent (void *data, const char *metacontext, "nr_entries=%zu\n", id, metacontext, offset, nr_entries); - if (strcmp (metacontext, "base:allocation") == 0) { + if (strcmp (metacontext, LIBNBD_CONTEXT_BASE_ALLOCATION) == 0) { for (i = 0; i < nr_entries...
2019 Aug 13
0
[PATCH libnbd 1/4] api: Combine callback and user_data into a single struct.
...a/tests/meta-base-allocation.c b/tests/meta-base-allocation.c index c36a77f..d4e331c 100644 --- a/tests/meta-base-allocation.c +++ b/tests/meta-base-allocation.c @@ -101,19 +101,24 @@ main (int argc, char *argv[]) /* Read the block status. */ id = 1; - if (nbd_block_status (nbd, 65536, 0, check_extent, &id, 0) == -1) { + if (nbd_block_status (nbd, 65536, 0, + (nbd_extent_callback) { .callback = check_extent, .user_data = &id }, + 0) == -1) { fprintf (stderr, "%s\n", nbd_get_error ()); exit (EXIT_FAILURE); } id...
2019 Aug 13
0
[PATCH libnbd 2/4] api: Add free function and remove valid_flag parameter.
...assert (completion_cb_freed == 1); exit (EXIT_SUCCESS); } diff --git a/tests/meta-base-allocation.c b/tests/meta-base-allocation.c index d4e331c..f6be463 100644 --- a/tests/meta-base-allocation.c +++ b/tests/meta-base-allocation.c @@ -30,7 +30,7 @@ #include <libnbd.h> -static int check_extent (unsigned valid_flag, void *data, +static int check_extent (void *data, const char *metacontext, uint64_t offset, uint32_t *entries, size_t nr_entries, int *error); @@ -134,7 +134,7 @@ main (int argc, char *argv[]) }...
2019 Jun 27
1
[libnbd PATCH] block-status: Make callback usage consistent with pread_structured
...value == 0 if metacontext != "base:allocation": return entries = e diff --git a/tests/meta-base-allocation.c b/tests/meta-base-allocation.c index a9ddbd0..8ae215e 100644 --- a/tests/meta-base-allocation.c +++ b/tests/meta-base-allocation.c @@ -30,7 +30,7 @@ static int check_extent (void *data, const char *metacontext, uint64_t offset, - uint32_t *entries, size_t nr_entries); + uint32_t *entries, size_t nr_entries, int *error); int main (int argc, char *argv[]) @@ -128,15 +128,16 @@ main (int argc...
2019 May 28
6
[RFC libnbd PATCH 0/4] Add CMD_FLAG_DF support
RFC because this is an API break, but we haven't declared stable API yet. If we like it, I'm working on using libnbd to implement the nbdkit-nbd plugin; knowing whether it is API version 0.1 or 0.2 will be useful. I also dabbled with allowing optional parameters in python, although my OCaml is weak enough that there may be cleaner ways to approach that. Eric Blake (4): api: Add flags
2019 Jul 24
0
[PATCH libnbd 2/3] lib: Implement closure lifetimes.
...int64_t cookie, int *error); struct command_cb { union { diff --git a/tests/meta-base-allocation.c b/tests/meta-base-allocation.c index 95e029b..b6a0e63 100644 --- a/tests/meta-base-allocation.c +++ b/tests/meta-base-allocation.c @@ -30,7 +30,7 @@ #include <libnbd.h> -static int check_extent (void *data, const char *metacontext, +static int check_extent (int valid_flag, void *data, const char *metacontext, uint64_t offset, uint32_t *entries, size_t nr_entries, int *error); @@ -128,12 +128,17 @@ main (int argc, char *argv[]) }...
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
2019 Jun 27
3
[libnbd PATCH] generator: Add support for namespace constants
This just defines the namespace, its contexts and related constants and the only supported one is currently base:allocation. The names of the constants are not very future-proof, but shorter than LIBNBD_META_NS_CONTEXT_BASE_ALLOCATION or similar. Currently the output looks like this: /* "base" namespace */ /* "base" namespace contexts */ /* "base:allocation"
2019 Jul 24
0
[PATCH libnbd v2 2/5] lib: Implement closure lifetimes.
...int64_t cookie, int *error); struct command_cb { union { diff --git a/tests/meta-base-allocation.c b/tests/meta-base-allocation.c index 95e029b..9e88d6b 100644 --- a/tests/meta-base-allocation.c +++ b/tests/meta-base-allocation.c @@ -30,7 +30,8 @@ #include <libnbd.h> -static int check_extent (void *data, const char *metacontext, +static int check_extent (unsigned valid_flag, void *data, + const char *metacontext, uint64_t offset, uint32_t *entries, size_t nr_entries, int *error); @@ -128,12 +129,18 @@ main...
2019 Jul 25
0
[PATCH libnbd v3 1/2] lib: Implement closure lifetimes.
...+ assert (completion_cb_free == 1); + + exit (EXIT_SUCCESS); +} diff --git a/tests/meta-base-allocation.c b/tests/meta-base-allocation.c index 95e029b..9e88d6b 100644 --- a/tests/meta-base-allocation.c +++ b/tests/meta-base-allocation.c @@ -30,7 +30,8 @@ #include <libnbd.h> -static int check_extent (void *data, const char *metacontext, +static int check_extent (unsigned valid_flag, void *data, + const char *metacontext, uint64_t offset, uint32_t *entries, size_t nr_entries, int *error); @@ -128,12 +129,18 @@ main...
2020 Sep 28
0
[libnbd PATCH 1/3] api: Add get_nr_meta_contexts, clear_meta_contexts
...Red Hat Inc. + * Copyright (C) 2013-2020 Red Hat Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,6 +30,8 @@ #include <libnbd.h> +#define BOGUS_CONTEXT "x-libnbd:nosuch" + static int check_extent (void *data, const char *metacontext, uint64_t offset, @@ -58,6 +60,18 @@ main (int argc, char *argv[]) exit (EXIT_FAILURE); } + /* No contexts requested by default */ + if ((r = nbd_get_nr_meta_contexts (nbd)) != 0) { + fprintf (...
2019 Jul 25
4
[PATCH libnbd v3 0/2] lib: Implement closure lifetimes.
I think I've addressed everything that was raised in review. Some of the highlights: - Callbacks should be freed reliably along all exit paths. - There's a simple test of closure lifetimes. - I've tried to use VALID|FREE in all the places where I'm confident that it's safe and correct to do. There may be more places. Note this is an optimization and shouldn't
2019 Aug 12
14
[PATCH libnbd 0/7] Add free callbacks and remove valid_flag.
As proposed here: https://www.redhat.com/archives/libguestfs/2019-August/msg00130.html I didn't actually read Eric's replies to that yet because I've been concentrating on writing these patches all day. Anyway here they are and I'll look at what Eric said about the proposal next. Rich.
2019 Jun 04
9
[PATCH libnbd v2 0/4] api: Implement concurrent writer.
v1: https://www.redhat.com/archives/libguestfs/2019-June/msg00014.html I pushed a few bits which are uncontroversial. The main changes since v1 are: An extra patch removes the want_to_send / check for nbd_aio_is_ready in examples/threaded-reads-and-writes.c. This logic was wrong since commit 6af72b87 as was pointed out by Eric in his review. Comments and structure of
2019 Jul 24
8
[PATCH libnbd v2 0/5] lib: Implement closure lifetimes.
v1 was here: https://www.redhat.com/archives/libguestfs/2019-July/thread.html#00231 The changes address everything that Eric picked up in his review of the first two patches. I have also added two more patches (4 and 5) which respectively fix docs and change int status -> unsigned status, as discussed. Passes make, check, check-valgrind. Rich.
2019 Jul 24
6
[PATCH libnbd 0/3] Implement closure lifetimes.
This implements most of what I wrote here: https://www.redhat.com/archives/libguestfs/2019-July/msg00213.html