[Libguestfs] [PATCH nbdkit v5 FINAL 13/19] xz: Disable extents information in this filter.

Richard W.M. Jones rjones at redhat.com
Thu Mar 28 16:18:40 UTC 2019


However we ought to support this in future because xz files contain
sparseness information, so add a note.
---
 filters/xz/xz.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/filters/xz/xz.c b/filters/xz/xz.c
index ec41f25..3013538 100644
--- a/filters/xz/xz.c
+++ b/filters/xz/xz.c
@@ -185,6 +185,16 @@ xz_can_write (struct nbdkit_next_ops *next_ops, void *nxdata,
   return 0;
 }
 
+/* Similar to above.  However xz files themselves do support
+ * sparseness so in future we should generate extents information. XXX
+ */
+static int
+xz_can_extents (struct nbdkit_next_ops *next_ops, void *nxdata,
+                void *handle)
+{
+  return 0;
+}
+
 /* Read data from the file. */
 static int
 xz_pread (struct nbdkit_next_ops *next_ops, void *nxdata,
@@ -238,6 +248,7 @@ static struct nbdkit_filter filter = {
   .prepare           = xz_prepare,
   .get_size          = xz_get_size,
   .can_write         = xz_can_write,
+  .can_extents       = xz_can_extents,
   .pread             = xz_pread,
 };
 
-- 
2.20.1




More information about the Libguestfs mailing list