search for: offset_extents

Displaying 15 results from an estimated 15 matches for "offset_extents".

2019 Mar 19
0
[PATCH nbdkit 5/9] offset: Implement mapping of extents.
...xtents. */ +static int +subtract_offset (uint64_t offs, uint64_t length, uint32_t type, + void *vp) +{ + struct nbdkit_extents_map *extents_map = vp; + + assert (offs >= offset); + offs -= offset; + return nbdkit_extent_add (extents_map, offs, length, type); +} + +static int +offset_extents (struct nbdkit_next_ops *next_ops, void *nxdata, + void *handle, uint32_t count, uint64_t offs, uint32_t flags, + struct nbdkit_extents_map *extents_map, + int *err) +{ + struct nbdkit_extents_map *map2; + + map2 = nbdkit_extents_new (); + if (map2 ==...
2019 Mar 20
0
[PATCH nbdkit 4/8] offset: Implement mapping of extents.
...de <stdint.h> #include <string.h> +#include <assert.h> #include <nbdkit-filter.h> @@ -132,6 +133,39 @@ offset_zero (struct nbdkit_next_ops *next_ops, void *nxdata, return next_ops->zero (nxdata, count, offs + offset, flags, err); } +/* Extents. */ +static int +offset_extents (struct nbdkit_next_ops *next_ops, void *nxdata, + void *handle, uint32_t count, uint64_t offs, uint32_t flags, + struct nbdkit_extents *extents, int *err) +{ + size_t i; + struct nbdkit_extents *extents2; + struct nbdkit_extent e; + + extents2 = nbdkit_extents_new...
2019 Mar 23
1
Re: [PATCH nbdkit 4/8] offset: Implement mapping of extents.
...ter on top of a plugin > supporting extents. > --- > filters/offset/offset.c | 35 +++++++++++++++++++++++++++++++++++ > 1 file changed, 35 insertions(+) If we don't change our minds on the interface in patch 1, then this looks correct. > +/* Extents. */ > +static int > +offset_extents (struct nbdkit_next_ops *next_ops, void *nxdata, > + void *handle, uint32_t count, uint64_t offs, uint32_t flags, > + struct nbdkit_extents *extents, int *err) > +{ > + size_t i; > + struct nbdkit_extents *extents2; > + struct nbdkit_extent e; >...
2019 Mar 28
0
[PATCH nbdkit v5 FINAL 10/19] offset: Implement mapping of extents.
...de <stdint.h> #include <string.h> +#include <assert.h> #include <nbdkit-filter.h> @@ -132,6 +133,40 @@ offset_zero (struct nbdkit_next_ops *next_ops, void *nxdata, return next_ops->zero (nxdata, count, offs + offset, flags, err); } +/* Extents. */ +static int +offset_extents (struct nbdkit_next_ops *next_ops, void *nxdata, + void *handle, uint32_t count, uint64_t offs, uint32_t flags, + struct nbdkit_extents *extents, int *err) +{ + size_t i; + struct nbdkit_extents *extents2; + struct nbdkit_extent e; + int64_t real_size = next_ops-&g...
2019 Apr 23
0
[nbdkit PATCH 2/4] filters: Utilize CLEANUP_EXTENTS_FREE
.../offset.c index ebd590b..24ccb4c 100644 --- a/filters/offset/offset.c +++ b/filters/offset/offset.c @@ -39,6 +39,8 @@ #include <nbdkit-filter.h> +#include "cleanup.h" + #define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL static int64_t offset = 0, range = -1; @@ -138,7 +140,7 @@ offset_extents (struct nbdkit_next_ops *next_ops, void *nxdata, struct nbdkit_extents *extents, int *err) { size_t i; - struct nbdkit_extents *extents2; + CLEANUP_EXTENTS_FREE struct nbdkit_extents *extents2 = NULL; struct nbdkit_extent e; int64_t real_size = next_ops->get_size (nx...
2019 Apr 24
4
[PATCH nbdkit 2/2] filters: Be careful to set *err if nbdkit_add_extent or nbdkit_extents_new fail.
This fix isn't exhaustive but it fixes some obvious problems in the filters. Rich.
2019 Aug 28
1
[nbdkit PATCH] offset, partition: Fix .extents with non-zero offset
...s, extents2, err); for (i = 0; i < nbdkit_extents_count (extents2); ++i) { e = nbdkit_get_extent (extents2, i); diff --git a/filters/offset/offset.c b/filters/offset/offset.c index efe5c6d1..00122770 100644 --- a/filters/offset/offset.c +++ b/filters/offset/offset.c @@ -140,9 +140,9 @@ offset_extents (struct nbdkit_next_ops *next_ops, void *nxdata, size_t i; CLEANUP_EXTENTS_FREE struct nbdkit_extents *extents2 = NULL; struct nbdkit_extent e; - int64_t real_size = next_ops->get_size (nxdata); + int64_t real_size = range >= 0 ? offset + range : next_ops->get_size (nxdata); -...
2019 Apr 24
0
[PATCH nbdkit 2/2] filters: Be careful to set *err if nbdkit_add_extent or nbdkit_extents_new fail.
...artition/partition.c | 4 +++- filters/truncate/truncate.c | 8 +++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/filters/offset/offset.c b/filters/offset/offset.c index 24ccb4c..633a1c7 100644 --- a/filters/offset/offset.c +++ b/filters/offset/offset.c @@ -156,8 +156,10 @@ offset_extents (struct nbdkit_next_ops *next_ops, void *nxdata, for (i = 0; i < nbdkit_extents_count (extents2); ++i) { e = nbdkit_get_extent (extents2, i); e.offset -= offset; - if (nbdkit_add_extent (extents, e.offset, e.length, e.type) == -1) + if (nbdkit_add_extent (extents, e.offset, e....
2019 Apr 24
1
Re: [PATCH nbdkit 2/2] filters: Be careful to set *err if nbdkit_add_extent or nbdkit_extents_new fail.
...ers/truncate/truncate.c | 8 +++++++- > 3 files changed, 13 insertions(+), 3 deletions(-) > > diff --git a/filters/offset/offset.c b/filters/offset/offset.c > index 24ccb4c..633a1c7 100644 > --- a/filters/offset/offset.c > +++ b/filters/offset/offset.c > @@ -156,8 +156,10 @@ offset_extents (struct nbdkit_next_ops *next_ops, void *nxdata, > for (i = 0; i < nbdkit_extents_count (extents2); ++i) { > e = nbdkit_get_extent (extents2, i); > e.offset -= offset; > - if (nbdkit_add_extent (extents, e.offset, e.length, e.type) == -1) > + if (nbdkit_add_exte...
2019 Apr 23
8
[nbdkit PATCH 0/4] Start using cleanup macros in filters/plugins
There's more that can be done (in particular, use of CLEANUP_FREE), but this is enough to at least see if I'm on the right track. I couldn't figure out an obvious difference between common/include and common/utils, but it looks like the former is for things that are inlineable via .h only, while the latter is when you need to link in a convenience library, so this landed in the
2019 Mar 20
15
[PATCH nbdkit 0/8] Implement extents using a simpler array.
Not sure what version we're up to, but this reimplements extents using the new simpler structure described in this thread: https://www.redhat.com/archives/libguestfs/2019-March/msg00077.html I also fixed most of the things that Eric pointed out in the previous review, although I need to go back over his replies and check I've got everything. This needs a bit more testing. However the
2019 Mar 26
21
[PATCH nbdkit v4 00/15] Implement Block Status.
I'm not sure exactly which version we're up to, but let's say it's version 4. I'm a lot happier with this version: - all filters have been reviewed and changed where I think that's necessary - can_extents is properly defined and implemented now - NBD protocol is followed - I believe it addresses all previous review points where possible The "only" thing
2019 Mar 19
15
[PATCH nbdkit 0/9] [mainly for discussion and early review] Implement extents.
I want to post this but mainly for discussion and early review. It's not safe for these patches to all go upstream yet (because not all filters have been checked/adjusted), but if any patches were to go upstream then probably 1 & 2 only are safe. File, VDDK, memory and data plugins all work, although I have only done minimal testing on them. The current tests, such as they are, all
2019 May 16
27
[nbdkit PATCH v2 00/24] implement NBD_CMD_CACHE
Since v1: - rework .can_cache to be tri-state, with default of no advertisement (ripple effect through other patches) - add a lot more patches in order to round out filter support And in the meantime, Rich pushed NBD_CMD_CACHE support into libnbd, so in theory we now have a way to test cache commands through the entire stack. Eric Blake (24): server: Internal hooks for implementing
2019 Mar 28
32
[PATCH nbdkit v5 FINAL 00/19] Implement extents.
This has already been pushed upstream. I am simply posting these here so we have a reference in the mailing list in case we find bugs later (as I'm sure we will - it's a complex patch series). Great thanks to Eric Blake for tireless review on this one. It also seems to have identified a few minor bugs in qemu along the way. Rich.