qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] Question about block driver


From: Kevin Wolf
Subject: Re: [Qemu-block] [Qemu-devel] Question about block driver
Date: Thu, 30 Apr 2015 11:52:01 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]