On Wed, Sep 11, 2019 at 08:48:28AM -0500, Eric Blake wrote:
On 9/11/19 5:40 AM, Richard W.M. Jones wrote:
> Very much a work in progress as there are still many tests using
> qemu-io which are candidates for conversion.
>
> You'll notice at the end of test-full.sh that the new test has some
> duplicated code which looks as if it ought to be refactored into a
> Python function. When I tried to do that, I got loads of strange
> Python problems which may indicate bugs in nbdsh itself or problems
> with my understanding of how Python works, but I wasn't sure how to
> fix it. The current implementation works.
I'm not sure if I'd spot the problem, but I'd least need to see your
alternative that didn't work before I can tell for sure :)
Attached is my alternative (on top of the current patch), which seems
to me straightforward, but actually fails with the attached error.
I tried variations inserting ‘global h’ in various places but couldn't
make it work.
Also note there are two related errors, because ‘nbd’ somehow get
"unimported" from the function too.
Needs help from someone who knows more Python :-)
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