> my image `fie.qcow2` is mounted elsewhere (nbd) and running
> `qemu-system-x86_64 -snapshot -hda file.qcow2` fails with the error
> "qemu-system-x86_64: -hda usb1.disk: Failed to get shared “write”
> lock / Is another process using the image [usb1.disk] ?".

Oh...

So you want concurrent access to the block device.
1) have it mounted on the host=HV using qemu-nbd
2) while at the same time, you want to give it to a guest VM?

Unless you use a filesystem such as GFS2 or OCFS2 inside the
partitions that exist inside that QCOW2 black box, or mount it
read-only at both ends, you are asking for trouble :-)
That is, if QEMU permits unlocked access by a VM, parallel to the
qemu-nbd loop-mount.

Note that this is just a tangential pointer on my part. Just a start
of a further journey. Further reading and study.

If you really want concurrent access to a directory tree, consider
using something like Samba or NFS as the simpler options.

Then again, concurrent access is definitely fun to play with and grow
:-)

Frank

Reply via email to