From: "Richard W.M. Jones" <rjones@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org, armbru@redhat.com, famz@redhat.com,
qemu-trivial@nongnu.org, mjt@tls.msk.ru, berrange@redhat.com
Subject: Re: [Qemu-trivial] [PATCH for-2.10] qemu-options: Document the -drive locking parameter.
Date: Tue, 12 Sep 2017 10:45:59 +0100 [thread overview]
Message-ID: <20170912094558.GO20914@redhat.com> (raw)
In-Reply-To: <20170906113845.GE3753@dhcp-200-186.str.redhat.com>
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/
WARNING: multiple messages have this Message-ID (diff)
From: "Richard W.M. Jones" <rjones@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org, armbru@redhat.com, famz@redhat.com,
qemu-trivial@nongnu.org, mjt@tls.msk.ru, berrange@redhat.com
Subject: Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive locking parameter.
Date: Tue, 12 Sep 2017 10:45:59 +0100 [thread overview]
Message-ID: <20170912094558.GO20914@redhat.com> (raw)
In-Reply-To: <20170906113845.GE3753@dhcp-200-186.str.redhat.com>
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/
next prev parent reply other threads:[~2017-09-12 9:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-06 8:50 [Qemu-trivial] [PATCH for-2.10] qemu-options: Document the -drive locking parameter Richard W.M. Jones
2017-09-06 8:50 ` [Qemu-devel] " Richard W.M. Jones
2017-09-06 8:59 ` [Qemu-trivial] " Daniel P. Berrange
2017-09-06 8:59 ` Daniel P. Berrange
2017-09-06 9:04 ` [Qemu-trivial] " Richard W.M. Jones
2017-09-06 9:04 ` Richard W.M. Jones
2017-09-06 9:31 ` [Qemu-trivial] " Richard W.M. Jones
2017-09-06 9:31 ` Richard W.M. Jones
2017-09-06 10:19 ` [Qemu-trivial] " Kevin Wolf
2017-09-06 10:19 ` [Qemu-devel] " Kevin Wolf
2017-09-06 10:44 ` [Qemu-trivial] " Richard W.M. Jones
2017-09-06 10:44 ` [Qemu-devel] " Richard W.M. Jones
2017-09-06 11:38 ` [Qemu-trivial] " Kevin Wolf
2017-09-06 11:38 ` [Qemu-devel] " Kevin Wolf
2017-09-12 9:45 ` Richard W.M. Jones [this message]
2017-09-12 9:45 ` Richard W.M. Jones
2017-09-12 11:32 ` [Qemu-trivial] " Kevin Wolf
2017-09-12 11:32 ` [Qemu-devel] " Kevin Wolf
2017-09-12 11:43 ` [Qemu-trivial] " Richard W.M. Jones
2017-09-12 11:43 ` [Qemu-devel] " Richard W.M. Jones
2017-09-12 12:20 ` [Qemu-trivial] " Kevin Wolf
2017-09-12 12:20 ` [Qemu-devel] " Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170912094558.GO20914@redhat.com \
--to=rjones@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.