Bug #5519

QEMU 2.10 file locking breaks commands underneath the running QEMU

Added by Vlastimil Holer over 3 years ago.

Status:PendingStart date:10/31/2017
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Drivers - VM
Target version:-
Resolution: Pull request:
Affected Versions:OpenNebula 5.4.2

Description

QEMU 2.10 comes with enabled builtin file locking to prevent image corruption (https://wiki.qemu.org/ChangeLog/2.10):

Image locking is added and enabled by default. Multiple QEMU processes cannot write to the same image as long as the host supports OFD or posix locking, unless options are specified otherwise.

If some operation with file image (resize/snapshots management) is done under hands of the running QEMU, it fails on lock acquire:

$ qemu-img resize /var/lib/one/datastores/0/39/disk.0 11264M
qemu-img: Could not open '/var/lib/one/datastores/0/39/disk.0': Failed to get "write" lock
Is another process using the image?

To disable locking, share-rw=on or file.locking=off (??) should be specified as parameters of particular -device or -drive on QEMU commandline, e.g.:
https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1716028
https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg05288.html

Don't see a way how to configure this via libvirt.

Also available in: Atom PDF