qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: qemu-devel@nongnu.org, Avi Kivity <avi@redhat.com>,
	"Richard W.M. Jones" <rjones@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] Disk image shared and exclusive locks.
Date: Mon, 7 Dec 2009 10:31:28 +0000	[thread overview]
Message-ID: <20091207103128.GA26970@shareable.org> (raw)
In-Reply-To: <4B1A9F8C.3010106@codemonkey.ws>

Anthony Liguori wrote:
> I'm not sure whether it's best to enable it by default because, as I 
> said earlier, I'm not comfortable with the lack of correctness wrt 
> advisory vs. mandatory locking.

In my experience, disk images are accessed in one of five ways:

    qemu-img
    qemu
    qemu-nbd
    mount -o loop
    cp/rsync

If all but the last implement qemu's advisory locking, that's comforting.

> Only qemu can implement this level of locking though so it's
> definitely something we ought to support.

That's not quite true.  I have management scripts which call qemu-img
to determine the chain of backing images, and then can lock the chain.
(They determine the chain anyway, to provide reliable behaviour with
image names containing unusual characters and the old monitor, by
creating links with sane names in /tmp to the real files.)

But it's a lot nicer if qemu does it.

> However, from a UI and implementation perspective, I think we need 
> significantly different semantics.  You either want locking or you 
> don't.  I don't think the selection of none|shared|exclusive really 
> makes sense.

Sometimes shared access to a raw image (partitioned or whole disk
filesystem) is ok, and sometimes it is not ok.  Only the user knows
the difference, because only the user knows if the guests they are
running use distinct partitions in the same raw image, or cooperative
access to a shard image.

But does it make sense to request a shared lock in that case?  Not
really.  If you have a group of guests correctly sharing an image, you
still want to prevent running the same group a second time - and a
shared lock wouldn't do that, because each group would be requesting
shared locks.

So the distinction read/write makes more sense.  Can anyone think of a
situation where a shared lock on an image opened for writing is useful?

-- Jamie

  reply	other threads:[~2009-12-07 10:31 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-04 16:53 [Qemu-devel] [PATCH] Disk image shared and exclusive locks Richard W.M. Jones
2009-12-04 17:15 ` Anthony Liguori
2009-12-04 21:57   ` Richard W.M. Jones
2009-12-04 22:29     ` Anthony Liguori
2009-12-05 17:31       ` Avi Kivity
2009-12-05 17:47         ` Anthony Liguori
2009-12-05 17:55           ` Avi Kivity
2009-12-05 17:59             ` Anthony Liguori
2009-12-07 10:31               ` Jamie Lokier [this message]
2009-12-07 10:42                 ` Kevin Wolf
2009-12-07 10:48                   ` Avi Kivity
2009-12-07 10:56                     ` Kevin Wolf
2009-12-07 11:28                   ` Jamie Lokier
2009-12-07 11:51                     ` Kevin Wolf
2009-12-07 12:06                     ` Daniel P. Berrange
2009-12-07 10:45                 ` Daniel P. Berrange
2009-12-07 11:19                   ` Jamie Lokier
2009-12-07 11:30                     ` Daniel P. Berrange
2009-12-07 11:31                       ` Richard W.M. Jones
2009-12-07 11:38                         ` Jamie Lokier
2009-12-07 11:49                         ` Daniel P. Berrange
2009-12-07 11:59                           ` Richard W.M. Jones
2009-12-07 14:35                           ` [Qemu-devel] " Paolo Bonzini
2009-12-07 13:43                       ` [Qemu-devel] " Anthony Liguori
2009-12-07 14:01                         ` Daniel P. Berrange
2009-12-07 14:15                           ` Anthony Liguori
2009-12-07 14:28                             ` Daniel P. Berrange
2009-12-07 14:53                               ` Anthony Liguori
2009-12-08  9:40                                 ` Kevin Wolf
2009-12-07 11:04                 ` Richard W.M. Jones
2009-12-07 10:58           ` Richard W.M. Jones
2009-12-07 11:35             ` Jamie Lokier
2009-12-07 13:39             ` Anthony Liguori
2009-12-07 14:08               ` Richard W.M. Jones
2009-12-07 14:22                 ` Anthony Liguori
2009-12-07 14:31                   ` Richard W.M. Jones
2009-12-07 14:55                     ` Anthony Liguori
2009-12-08  9:48                     ` Kevin Wolf
2009-12-08 10:16                       ` Richard W.M. Jones
2009-12-07 14:38               ` [Qemu-devel] " Paolo Bonzini
2009-12-07  9:38   ` [Qemu-devel] " Daniel P. Berrange
2009-12-07 10:39 ` Chris Webb
2009-12-07 13:32   ` Anthony Liguori
2009-12-07 13:38     ` Chris Webb
2009-12-07 13:47       ` Anthony Liguori
2009-12-07 14:25     ` Daniel P. Berrange
2009-12-07 14:58       ` Chris Webb
2009-12-07 14:16 ` [Qemu-devel] [PATCH VERSION 2] " Richard W.M. Jones
2009-12-07 15:06   ` Anthony Liguori
2009-12-08  8:48     ` [Qemu-devel] " Paolo Bonzini
2009-12-08 10:00   ` [Qemu-devel] " Kevin Wolf
2009-12-08 10:25     ` Richard W.M. Jones

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=20091207103128.GA26970@shareable.org \
    --to=jamie@shareable.org \
    --cc=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rjones@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).