qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 1/3] block: block: introduce bdrv_io_plug() a


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2 1/3] block: block: introduce bdrv_io_plug() and bdrv_io_unplug()
Date: Tue, 01 Jul 2014 18:56:13 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

Il 01/07/2014 17:21, Kevin Wolf ha scritto:
Does this bs->file forwarding work for more than the raw driver? For
example, if drv is an image format driver that needs to read some
metadata from the image before it can submit the payload, does this
still do what you were intending?

Sorry for not understanding the problem, and you are right, these
patches can't support other formats, and for solving the dependency,
changes to image format driver should be needed.

Then let's drop the bs->file recursion here and add an explicit
.bdrv_io_plug/unplug callback to the raw driver.

Actually I thought about this in my review, and there's no reason for this not to work for image formats.

While bs->file is plugged, image formats will start executing their bdrv_co_readv/bdrv_co_writev callbacks, and issue reads or writes as necessary. The reads and writes will accumulate in bs->file until it is unplugged, which is exactly the effect we want.

The change in bdrv_drain_all is ugly though. I don't have a better idea, but I would like to understand better why it is needed. Ming Lei, did you see a deadlock without it?

Paolo



reply via email to

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