On Mon, Aug 10, 2020 at 11:50:59AM +0100, Richard W.M. Jones wrote:
+ def test_extents_1 (self):
+ """Test extents."""
+
+ offset = None
+ entries = []
+
+ def f(meta_context, o, e, err):
+ nonlocal offset, entries
+ if meta_context != "base:allocation": return
+ offset = o
+ entries = e
+
+ self.h.add_meta_context ("base:allocation")
+ self.connect ({"size": 512,
+ "can_extents": True,
+ "extents":
+ [ (0, 512, self.EXTENT_HOLE|self.EXTENT_ZERO) ]})
+
+ self.h.block_status (512, 0, lambda *args : f (*args))
This can of course just be "f" instead of using the pointless
lambda (and in other places). I updated my copy.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top