Displaying 16 results from an estimated 16 matches for "backend_extents".
2020 Jul 08
1
Re: [nbdkit PATCH 3/3] RFC swab: Re-enable .extents
...39; can_extents='exit 0' extents='printf "0 3\n3 4 hole,zero\n7 1\n"' --run 'qemu-img map -f raw --output=json $uri'
> 
> except it's currently failing:
> nbdkit: eval[1]: error: swab: requests to this filter must be aligned
> nbdkit: backend.c:621: backend_extents: Assertion `*err' failed.
> qemu-img: Could not read file metadata: Input/output error
I would add -v to the command line, as it will show you exactly what
requests qemu-img is making.  The assert failure seems to be a
separate and worrying problem.
Rich.
>  filters/swab/swab.c | 16 ++...
2020 Feb 11
0
[PATCH nbdkit 3/3] server: Remove explicit connection parameter, use TLS instead.
...ero (struct backend *b, struct connection *conn,
+  __attribute__((__nonnull__ (1, 5)));
+extern int backend_zero (struct backend *b,
                          uint32_t count, uint64_t offset, uint32_t flags,
                          int *err)
-  __attribute__((__nonnull__ (1, 2, 6)));
-extern int backend_extents (struct backend *b, struct connection *conn,
+  __attribute__((__nonnull__ (1, 5)));
+extern int backend_extents (struct backend *b,
                             uint32_t count, uint64_t offset, uint32_t flags,
                             struct nbdkit_extents *extents, int *err)
-  __attribute__(...
2020 Jul 07
0
[nbdkit PATCH 3/3] RFC swab: Re-enable .extents
...t_size='echo 8' can_extents='exit 0' extents='printf "0 3\n3 4 hole,zero\n7 1\n"' --run 'qemu-img map -f raw --output=json $uri'
except it's currently failing:
nbdkit: eval[1]: error: swab: requests to this filter must be aligned
nbdkit: backend.c:621: backend_extents: Assertion `*err' failed.
qemu-img: Could not read file metadata: Input/output error
---
 filters/swab/swab.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/filters/swab/swab.c b/filters/swab/swab.c
index 57a51aee..2e423bbf 100644
--- a/filters/swab/swab.c...
2020 Feb 11
4
[PATCH nbdkit v2 0/3] server: Remove explicit connection parameter.
v1 was here:
https://www.redhat.com/archives/libguestfs/2020-February/msg00081.html
v2 replaces
  struct connection *conn = GET_CONN;
with
  GET_CONN;
which sets conn implicitly and asserts that it is non-NULL.
If we actually want to test if conn is non-NULL or behave
differently, then you must use threadlocal_get_conn() instead,
and some existing uses do that.
Rich.
2020 Feb 12
5
[PATCH nbdkit 1/3] server: Rename global backend pointer to "top".
...BDKIT_FLAG_FAST_ZERO;
-    if (backend_zero (backend, count, offset, f, &err) == -1)
+    if (backend_zero (top, count, offset, f, &err) == -1)
       return err;
     break;
 
   case NBD_CMD_BLOCK_STATUS:
     if (flags & NBD_CMD_FLAG_REQ_ONE)
       f |= NBDKIT_FLAG_REQ_ONE;
-    if (backend_extents (backend, count, offset, f,
+    if (backend_extents (top, count, offset, f,
                          extents, &err) == -1)
       return err;
     break;
@@ -683,7 +683,7 @@ protocol_recv_request_send_reply (void)
 
     /* Allocate the extents list for block status only. */
     if (cmd == N...
2020 Feb 11
5
[PATCH nbdkit 0/3] server: Remove explicit connection parameter.
The third patch is a large but mechanical change which gets rid of
passing around struct connection * entirely within the server,
preferring instead to reference the connection through thread-local
storage.
I hope this is a gateway to simplifying other parts of the code.
Rich.
2020 Feb 12
2
[nbdkit PATCH] filters: Remove most next_* wrappers
...-{
-  struct backend *b_next = nxdata;
-  return backend_zero (b_next, count, offset, flags, err);
-}
-
-static int
-next_extents (void *nxdata, uint32_t count, uint64_t offset, uint32_t flags,
-              struct nbdkit_extents *extents, int *err)
-{
-  struct backend *b_next = nxdata;
-  return backend_extents (b_next, count, offset, flags, extents, err);
-}
-
-static int
-next_cache (void *nxdata, uint32_t count, uint64_t offset,
-            uint32_t flags, int *err)
-{
-  struct backend *b_next = nxdata;
-  return backend_cache (b_next, count, offset, flags, err);
-}
-
 static struct nbdkit_next_ops n...
2020 Feb 12
0
[PATCH nbdkit 3/3] server: filters: Remove struct b_h.
...gs, err);
+  struct backend *b_next = nxdata;
+  return backend_zero (b_next, count, offset, flags, err);
 }
 
 static int
 next_extents (void *nxdata, uint32_t count, uint64_t offset, uint32_t flags,
               struct nbdkit_extents *extents, int *err)
 {
-  struct b_h *b_h = nxdata;
-  return backend_extents (b_h->b, count, offset, flags,
-                          extents, err);
+  struct backend *b_next = nxdata;
+  return backend_extents (b_next, count, offset, flags, extents, err);
 }
 
 static int
 next_cache (void *nxdata, uint32_t count, uint64_t offset,
             uint32_t flags, int *err)...
2020 Jul 07
6
[RFC nbdkit PATCH 0/3] aligned .extents
Ultimately, both the blocksize and swab filters want to return aligned
extents to the client.  I'm posting this as a snapshot of my work in
progress on how I plan to get there (it's not quite working yet, but
I'm done for today and wanted to at least document my ideas).
I might also add a convenience function for nbdkit_extents_offset,
since we have a number of filters that repeat the
2019 Aug 30
15
[nbdkit PATCH 0/9] can_FOO caching, more filter validation
It's easy to use the sh script to demonstrate that nbdkit is
inefficiently calling into .get_size, .can_fua, and friends more than
necessary.  We've also commented on the list in the past that it would
be nice to ensure that when filters call into next_ops, they are not
violating constraints (as we've have to fix several bugs in the past
where we did not have such checking to protect
2020 Feb 12
0
[PATCH nbdkit 2/3] server: Rename ‘struct b_conn_handle’ to plain ‘struct handle’.
...ruct backend *b,
               int *err)
 {
   GET_CONN;
-  struct b_conn_handle *h = &conn->handles[b->i];
+  struct handle *h = get_handle (conn, b->i);
   bool fua = !!(flags & NBDKIT_FLAG_FUA);
   bool fast = !!(flags & NBDKIT_FLAG_FAST_ZERO);
   int r;
@@ -601,7 +601,7 @@ backend_extents (struct backend *b,
                  struct nbdkit_extents *extents, int *err)
 {
   GET_CONN;
-  struct b_conn_handle *h = &conn->handles[b->i];
+  struct handle *h = get_handle (conn, b->i);
   int r;
 
   assert (h->handle && (h->state & HANDLE_CONNECTED));
@@ -63...
2019 Aug 30
0
[nbdkit PATCH 9/9] server: Move command validation from protocol.c to backend.c
...{
+    nbdkit_error ("invalid request: write zeroes operation not supported");
+    *err = EINVAL;
+    return -1;
+  }
   r = b->zero (b, conn, count, offset, flags, err);
   if (r == -1)
     assert (*err && *err != ENOTSUP && *err != EOPNOTSUPP);
@@ -368,6 +454,10 @@ backend_extents (struct backend *b, struct connection *conn,
   debug ("%s: extents count=%" PRIu32 " offset=%" PRIu64 " req_one=%d",
          b->name, count, offset, !!(flags & NBDKIT_FLAG_REQ_ONE));
+  if (invalid_range (b, conn, "extents", offset, count)) {
+...
2019 Aug 30
0
[nbdkit PATCH 6/9] server: Cache per-connection can_FOO flags
...der to perform a fallback when needed.
      */
-    if (conn->can_extents) {
+    r = backend_can_extents (backend, conn);
+    assert (r >= 0); /* Guaranteed during eflags computation */
+    if (r) {
       if (flags & NBD_CMD_FLAG_REQ_ONE)
         f |= NBDKIT_FLAG_REQ_ONE;
       if (backend_extents (backend, conn, count, offset, f,
@@ -304,8 +334,6 @@ handle_request (struct connection *conn,
         return err;
     }
     else {
-      int r;
-
       /* By default it is safe assume that everything in the range is
        * allocated.
        */
diff --git a/filters/blocksize/blocksize.c b/...
2019 Oct 07
6
[nbdkit PATCH 0/5] More retry fixes
I think this is my last round of patches for issues I identified with
the retry filter.  With this in place, it should be safe to interject
another filter in between retry and the plugin.
Eric Blake (5):
  retry: Don't call into closed plugin
  tests: Refactor test-retry-reopen-fail.sh
  tests: Enhance retry test to cover failed reopen
  server: Move prepare/finalize/close recursion to
2019 Dec 12
9
[PATCH nbdkit 0/7] server: Allow datapath debug messages to be suppressed.
The immediate reason for this patch is to reduce the amount of
debugging in virt-v2v with using the virt-v2v -v option (because this
implies running nbdkit in verbose mode too).  Most of the messages are
datapath ones about pread/pwrite requests, and in fact as we've added
more filters on top of nbdkit these messages have got more and more
verbose.  However they are not particularly
2019 Oct 04
6
[nbdkit PATCH 0/5] Another round of retry fixes
I still don't have .prepare/.finalize working cleanly across reopen,
but did find a nasty bug where a botched assertion means we failed to
notice reads beyond EOF in both the xz and retry filter.
Refactoring backend.c will make .finalize work easier.
Eric Blake (5):
  xz: Avoid reading beyond EOF
  retry: Check size before transactions
  tests: Test retry when get_size values change