[Libguestfs] [PATCH v2v v2] nbdkit: Use cacheextents if possible for vddk input

Martin Kletzander mkletzan at redhat.com
Thu Nov 14 12:56:33 UTC 2019


It does not need configuring and speeds up the process of requesting extents if
the client asks for them one by one (like qemu-img).

Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
---
Essentially a v2 of the following patch since now there is a probing function:

  https://www.redhat.com/archives/libguestfs/2019-September/msg00249.html

 v2v/nbdkit.ml | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/v2v/nbdkit.ml b/v2v/nbdkit.ml
index 89fca337cbaa..77d2a506dc41 100644
--- a/v2v/nbdkit.ml
+++ b/v2v/nbdkit.ml
@@ -169,6 +169,13 @@ let common_create ?bandwidth plugin_name plugin_args plugin_env =
     )
     else [] in
 
+  (* Caching extents speeds up qemu-img, especially its consecutive
+     block_status requests with req_one=1.
+  *)
+  if probe_filter "cacheextents" then (
+    add_arg "--filter"; add_arg "cacheextents"
+  );
+
   (* Retry filter (if it exists) can be used to get around brief
    * interruptions in service.  It must be closest to the plugin.
    *)
-- 
2.24.0




More information about the Libguestfs mailing list