qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Jack Wang <jinpu.wang@profitbricks.com>
Cc: kwolf@redhat.com, Paolo Bonzini <pbonzini@redhat.com>,
	NeilBrown <neilb@suse.de>,
	Dongsu Park <dongsu.park@profitbricks.com>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [RFC] O_EXCL or not open block device
Date: Thu, 12 Sep 2013 15:58:36 +0200	[thread overview]
Message-ID: <20130912135836.GE18070@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <5231A524.2080103@profitbricks.com>

On Thu, Sep 12, 2013 at 01:27:32PM +0200, Jack Wang wrote:
> Hi all,
> 
> We're using qemu export md-raid to guest OS, and we saw deadlock on
> MD(which is already fixed by Neil), please see thread below:
> > http://marc.info/?l=linux-raid&m=137894040228125&w=2
> 
> As Neil suggested it would be good for userspace applications to call
> open() with O_EXCL flag, to avoid such MD hanging problems at the begining.
> 
> And we checked qemu, it looks it doesn't include O_EXCL flag when open
> block device.
> 
> After search in the mail list we found there are a similar discussion:
> 
> https://lists.nongnu.org/archive/html/qemu-devel/2011-04/msg00722.html
> 
> > To O_EXCL or not to O_EXCL open host_cdrom
> 
> Which looks prefer enable O_EXCL, but I checked latest qemu tree, there
> no such code, could anyone give comments on this?

Continuing from that discussion, I think the shared CD-ROM case is
something we must avoid breaking.  It worked in the past so it shouldn't
break in a new QEMU version.

Kevin: Do you think we should add an option to the host_device
BlockDriver that sets the O_EXCL open flag?  That way users and new
libvirt can use O_EXCL for host block devices.

The simpler alternative is to always use O_EXCL for non-CDROM host
devices.  Simple patch, no configuration required, but it means we
continue to lack O_EXCL on CD-ROMs.

Stefan

  reply	other threads:[~2013-09-12 13:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-12 11:27 [Qemu-devel] [RFC] O_EXCL or not open block device Jack Wang
2013-09-12 13:58 ` Stefan Hajnoczi [this message]
2013-09-12 14:27   ` Kevin Wolf
2013-09-12 15:57     ` Jack Wang
2013-09-12 22:48     ` NeilBrown
2013-09-13  7:16       ` Paolo Bonzini

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=20130912135836.GE18070@stefanha-thinkpad.redhat.com \
    --to=stefanha@redhat.com \
    --cc=dongsu.park@profitbricks.com \
    --cc=jinpu.wang@profitbricks.com \
    --cc=kwolf@redhat.com \
    --cc=neilb@suse.de \
    --cc=pbonzini@redhat.com \
    --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).