Well the patch is attached ... but ... it doesn't solve the problem
at all:
libguestfs: trace: disk_virtual_size "test1.vmdk"
libguestfs: command: run: qemu-img
libguestfs: command: run: \ info
libguestfs: command: run: \ --output json
libguestfs: command: run: \ test1.vmdk
qemu-img: Could not open 'test1.vmdk': Failed to get shared "write"
lock
Is another process using the image?
libguestfs: trace: disk_virtual_size = -1 (error)
qemu-img info: test1.vmdk: qemu-img info exited with error status 1, see debug messages
above at /var/tmp/test.pl line 17.
I think the patch is probably a good thing (aside from not fixing the
bug), so I've attached it for review.
- - -
Now that I've had time to look at the reported bug, I'm in two minds
about whether this is really a bug.
What's happening [in the Perl test case, not necessarily in Yaniv's
case] is that libguestfs is opening the VMDK file for write, and at
the same time ‘qemu-img info’ is opening the VMDK file for read.
That's not necessarily a safe operation and qemu is preventing it.
The VMDK format is ridiculously complicated so it's not really clear
if this use case could be made safe in specific cases. For qcow2 this
is also a difficult case (which could possibly be made better by
allowing selective locking of parts of the header).
TL;DR: Ask Kevin or Fam.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/