From: "Richard W.M. Jones" <rjones@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] One more thing about block device locking
Date: Fri, 23 Apr 2010 09:00:25 +0100 [thread overview]
Message-ID: <20100423080025.GA1639@amd.home.annexia.org> (raw)
In-Reply-To: <4BD12B10.1060304@msgid.tls.msk.ru>
On Fri, Apr 23, 2010 at 09:07:28AM +0400, Michael Tokarev wrote:
> So we'll have to either
> trial and error, or open "normally", check
> if it's a block device and re-open with that
> flag set.
Perhaps I'm missing something, but why can't you stat(2) the name
first to see if it's a block device (ie. S_ISBLK(st_mode)) then add
the O_EXCL flag or not as appropriate?
Anyway, the problem with this is it's not helpful (in fact: actively
bad) for libguestfs. We want to allow people to open existing devices
read-only, even if one qemu process has them open for writing.
Consider, for example, virt-df or virt-cat which allow you to read
information out from live VMs.
This is why we should have exclusive|shared modes for locking (or if
you prefer write|read -- it's the same thing with a different name
AFAICT).
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v
next prev parent reply other threads:[~2010-04-23 9:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-23 5:07 [Qemu-devel] One more thing about block device locking Michael Tokarev
2010-04-23 8:00 ` Richard W.M. Jones [this message]
2010-04-23 10:45 ` Michael Tokarev
2010-04-23 12:57 ` 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=20100423080025.GA1639@amd.home.annexia.org \
--to=rjones@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=qemu-devel@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 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).