[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive lock
From: |
Richard W.M. Jones |
Subject: |
Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive locking parameter. |
Date: |
Tue, 12 Sep 2017 10:45:59 +0100 |
User-agent: |
Mutt/1.5.20 (2009-12-10) |
On Wed, Sep 06, 2017 at 01:38:45PM +0200, Kevin Wolf wrote:
> This command line fragment looks correct to me. For me, it seems to
> work. I'm starting a first qemu in the background with default locking
> options:
>
> $ x86_64-softmmu/qemu-system-x86_64 -hda /tmp/test.qcow2
>
> And then starting a second one with a command line resembling yours:
>
> $ x86_64-softmmu/qemu-system-x86_64 -device virtio-scsi \
> -drive
> file=/tmp/test.qcow2,cache=unsafe,format=qcow2,file.locking=off,id=hd0,if=none
> \
> -device scsi-hd,drive=hd0
The problem is with overlays, where file.locking doesn't propagate to
the backing file. Thus:
$ qemu-system-x86_64 -drive file=backing,format=raw
while in another terminal:
$ qemu-img create -b backing -f qcow2 overlay
$ qemu-system-x86_64 -drive file=overlay,format=qcow2,file.locking=off
qemu-system-x86_64: Failed to get shared "write" lock
Is another process using the image?
After some experimentation, I came up with this command which works:
$ qemu-system-x86_64 -drive
file.file.filename=overlay,file.driver=qcow2,file.backing.file.locking=off
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/