qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Wen Congyang <wency@cn.fujitsu.com>
Cc: qemu-block@nongnu.org, Fam Zheng <famz@redhat.com>,
	qemu-devl <qemu-devel@nongnu.org>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] Question about block driver
Date: Thu, 30 Apr 2015 11:52:01 +0200	[thread overview]
Message-ID: <20150430095201.GB3368@noname.redhat.com> (raw)
In-Reply-To: <5541F934.8010100@cn.fujitsu.com>

Am 30.04.2015 um 11:43 hat Wen Congyang geschrieben:
> On 04/30/2015 05:33 PM, Kevin Wolf wrote:
> > [Cc: qemu-block]
> > 
> > Am 30.04.2015 um 11:11 hat Wen Congyang geschrieben:
> >> Some drivers use bdrv_open, while the other dirvers use bdrv_file_open().
> >> What is the difference between bdrv_open() and bdrv_file_open()?
> > 
> > bdrv_file_open() is used by protocol drivers that don't need any other
> > driver to work (e.g. raw-posix), bdrv_open() is used by format drivers
> > that need a bs->file (e.g. raw or qcow2).
> > 
> > They used to have different parameters originally, but nowadays that's
> > the only difference.
> 
> So, if the driver wants to open bs->file itself, it should use bdrv_file_open(),
> and the driver wants bs->file has already been opened before its open, it should
> use bdrv_open(). Is it right?

Yes, that's how it works, even though I don't think a driver exists that
opens bs->file by itself.

Kevin

  reply	other threads:[~2015-04-30  9:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-30  9:11 [Qemu-devel] Question about block driver Wen Congyang
2015-04-30  9:33 ` Kevin Wolf
2015-04-30  9:43   ` Wen Congyang
2015-04-30  9:52     ` Kevin Wolf [this message]
2015-04-30 15:46       ` Stefan Hajnoczi

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=20150430095201.GB3368@noname.redhat.com \
    --to=kwolf@redhat.com \
    --cc=famz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=wency@cn.fujitsu.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).