Re: [Qemu-block] [Qemu-stable] [PATCH v2 0/2] backup: Fail early if cannot determine cluster size

2016-05-23 Thread Fam Zheng
On Thu, 05/19 09:25, Fam Zheng wrote: > v2: More accurately, s:hang:trigger assertion failure: in the bug fix patch > commit message. > Add John's and Jeff's R-b. > Add a test. [Eric] Jeff, will you take this series in your tree? Fam

Re: [Qemu-block] [PATCH V2] block/iscsi: allow caching of the allocation map

2016-05-23 Thread Fam Zheng
On Fri, 05/20 12:10, Peter Lieven wrote: > until now the allocation map was used only as a hint if a cluster > is allocated or not. If a block was not allocated (or Qemu had > no info about the allocation status) a get_block_status call was > issued to check the allocation status and possibly

Re: [Qemu-block] [Qemu-devel] [PATCH 5/7] scsi-disk: add need_fua_emulation to SCSIDiskClass

2016-05-23 Thread Fam Zheng
On Mon, 05/23 14:54, Paolo Bonzini wrote: > scsi-block will be able to do FUA just by passing the request through > to the LUN (which is also more efficient); there is no need to emulate > it like we do for scsi-disk. Even for scsi-disk, shall we just use the block layer FUA fallback already by

Re: [Qemu-block] coroutines: block: Co-routine re-entered recursively when migrating disk with iothreads

2016-05-23 Thread Fam Zheng
On Mon, 05/23 14:54, Jason J. Herne wrote: > Using libvirt to migrate a guest and one guest disk that is using iothreads > causes Qemu to crash with the message: > Co-routine re-entered recursively > > I've looked into this one a bit but I have not seen anything that > immediately stands out. >

Re: [Qemu-block] [Qemu-devel] [PATCH v3] block: Fix bdrv_next() memory leak

2016-05-23 Thread Fam Zheng
On Fri, 05/20 19:17, Kevin Wolf wrote: > The bdrv_next() users all leaked the BdrvNextIterator after completing > the iteration. Simply changing bdrv_next() to free the iterator before > returning NULL at the end of list doesn't work because some callers exit > the loop before looking at all

Re: [Qemu-block] [PATCH 0/4] block: BdrvChildRole.drained_begin/end fixes

2016-05-23 Thread Fam Zheng
On Mon, 05/23 18:55, Kevin Wolf wrote: > While working on the series that converts block jobs to using a separate > BlockBackend, I noticed that I need to do some drain fixes first. So here they > are. > > Patches 1 and 2 are just preparation, patches 3 and 4 are the actual fixes. > > Kevin Wolf

Re: [Qemu-block] [Qemu-devel] [PATCH 3/4] block: Fix reconfiguring graph with drained nodes

2016-05-23 Thread Eric Blake
On 05/23/2016 10:55 AM, Kevin Wolf wrote: > When changing the BlockDriverState that a BdrvChild points to while the > node is currently drained, we must call the .drained_end() parent > callback. Conversely, when this means attaching a new node that is > already drained, we need to call

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/7] dma-helpers, scsi-block: use SG_IO for all I/O on scsi-block

2016-05-23 Thread Mark Cave-Ayland
On 23/05/16 13:54, Paolo Bonzini wrote: > scsi-block uses the block layer for reads and writes in order to avoid > allocating bounce buffers as big as the transferred data. We know how > to split a large transfer to multiple reads and writes, and thus we can > use scsi-disk.c's existing code to

[Qemu-block] coroutines: block: Co-routine re-entered recursively when migrating disk with iothreads

2016-05-23 Thread Jason J. Herne
Using libvirt to migrate a guest and one guest disk that is using iothreads causes Qemu to crash with the message: Co-routine re-entered recursively I've looked into this one a bit but I have not seen anything that immediately stands out. Here is what I have found: In qemu_coroutine_enter:

Re: [Qemu-block] [Qemu-devel] [PATCH 1/4] block: Introduce bdrv_replace_child()

2016-05-23 Thread Eric Blake
On 05/23/2016 10:55 AM, Kevin Wolf wrote: > This adds a common function that is called when attaching a new child to > a parent, removing a child from a parent and when reconfiguring the > graph so that an existing child points to a different node now. > > Signed-off-by: Kevin Wolf

Re: [Qemu-block] [Qemu-devel] [PATCH 7/7] scsi-block: always use SG_IO

2016-05-23 Thread Eric Blake
On 05/23/2016 06:54 AM, Paolo Bonzini wrote: > Using pread/pwrite or io_submit has the advantage of eliminating the > bounce buffer, but drops the SCSI status. This keeps the guest from > seeing unit attention codes, as well as statuses such as RESERVATION > CONFLICT. Because we know scsi-block

Re: [Qemu-block] [Qemu-devel] [PATCH 6/7] scsi-disk: introduce scsi_disk_req_check_error

2016-05-23 Thread Eric Blake
On 05/23/2016 06:54 AM, Paolo Bonzini wrote: > Commonize all the checks for canceled requests and errors. The next patch > will add another case to check for, in order to handle passthrough commands. > > There is no semantic change here; the only nontrivial modification is in >

[Qemu-block] [PATCH 3/4] block: Fix reconfiguring graph with drained nodes

2016-05-23 Thread Kevin Wolf
When changing the BlockDriverState that a BdrvChild points to while the node is currently drained, we must call the .drained_end() parent callback. Conversely, when this means attaching a new node that is already drained, we need to call .drained_begin(). bdrv_root_attach_child() takes now an

[Qemu-block] [PATCH 1/4] block: Introduce bdrv_replace_child()

2016-05-23 Thread Kevin Wolf
This adds a common function that is called when attaching a new child to a parent, removing a child from a parent and when reconfiguring the graph so that an existing child points to a different node now. Signed-off-by: Kevin Wolf --- block.c | 26 -- 1

[Qemu-block] [PATCH 0/4] block: BdrvChildRole.drained_begin/end fixes

2016-05-23 Thread Kevin Wolf
While working on the series that converts block jobs to using a separate BlockBackend, I noticed that I need to do some drain fixes first. So here they are. Patches 1 and 2 are just preparation, patches 3 and 4 are the actual fixes. Kevin Wolf (4): block: Introduce bdrv_replace_child()

[Qemu-block] [PATCH 2/4] block: Make bdrv_drain() use bdrv_drained_begin/end()

2016-05-23 Thread Kevin Wolf
Until now, bdrv_drained_begin() used bdrv_drain() internally to drain the queue. This is kind of backwards and caused quiescing code to be duplicated because bdrv_drained_begin() had to ensure that no new requests come in even after bdrv_drain() returns, whereas bdrv_drain() had to have them

Re: [Qemu-block] [Qemu-devel] [PATCH 5/7] scsi-disk: add need_fua_emulation to SCSIDiskClass

2016-05-23 Thread Eric Blake
On 05/23/2016 06:54 AM, Paolo Bonzini wrote: > scsi-block will be able to do FUA just by passing the request through > to the LUN (which is also more efficient); there is no need to emulate > it like we do for scsi-disk. > > Add a new method to distinguish this. > > Signed-off-by: Paolo Bonzini

Re: [Qemu-block] [Qemu-devel] [PATCH 4/7] scsi-disk: introduce dma_readv and dma_writev

2016-05-23 Thread Eric Blake
On 05/23/2016 06:54 AM, Paolo Bonzini wrote: > These are replacements for blk_aio_preadv and blk_aio_pwritev that allow > customization of the data path. They reuse the DMA helpers' DMAIOFunc > callback type, so that the same function can be used in either the > QEMUSGList or the bounce-buffered

Re: [Qemu-block] [PATCH v7 03/19] block: Switch blk_*write_zeroes() to byte interface

2016-05-23 Thread Eric Blake
On 05/23/2016 09:42 AM, Kevin Wolf wrote: > Am 06.05.2016 um 18:26 hat Eric Blake geschrieben: >> Sector-based blk_write() should die; convert the one-off >> variant blk_write_zeroes() to use an offset/count interface >> instead. Likewise for blk_co_write_zeroes() and >> blk_aio_write_zeroes().

Re: [Qemu-block] [Qemu-devel] [PATCH 3/7] scsi-disk: introduce a common base class

2016-05-23 Thread Eric Blake
On 05/23/2016 06:54 AM, Paolo Bonzini wrote: > This will be the place to add DMAIOFuncs in the next patch. There > are also a couple DeviceClass members that can be moved to the > abstract class's initialization function. > > Signed-off-by: Paolo Bonzini > --- >

Re: [Qemu-block] [Qemu-devel] [PATCH 2/7] dma-helpers: change BlockBackend to opaque value in DMAIOFunc

2016-05-23 Thread Eric Blake
On 05/23/2016 06:54 AM, Paolo Bonzini wrote: > Callers of dma_blk_io have no way to pass extra data to the DMAIOFunc, > because the original callback and opaque are gone by the time DMAIOFunc > is called. On the other hand, the BlockBackend is usually derived > from those extra data that you

Re: [Qemu-block] [PATCH v7 03/19] block: Switch blk_*write_zeroes() to byte interface

2016-05-23 Thread Kevin Wolf
Am 06.05.2016 um 18:26 hat Eric Blake geschrieben: > Sector-based blk_write() should die; convert the one-off > variant blk_write_zeroes() to use an offset/count interface > instead. Likewise for blk_co_write_zeroes() and > blk_aio_write_zeroes(). > > Signed-off-by: Eric Blake

Re: [Qemu-block] [Qemu-devel] [PATCH 1/7] dma-helpers: change interface to byte-based

2016-05-23 Thread Eric Blake
On 05/23/2016 06:54 AM, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > dma-helpers.c| 14 +++--- > hw/block/nvme.c | 6 +++--- > hw/ide/ahci.c| 6 -- > hw/ide/core.c| 8 +--- > hw/scsi/scsi-disk.c | 6 -- >

[Qemu-block] [PATCH 7/7] scsi-block: always use SG_IO

2016-05-23 Thread Paolo Bonzini
Using pread/pwrite or io_submit has the advantage of eliminating the bounce buffer, but drops the SCSI status. This keeps the guest from seeing unit attention codes, as well as statuses such as RESERVATION CONFLICT. Because we know scsi-block operates on an SBC device we can still use the DMA

[Qemu-block] [PATCH 4/7] scsi-disk: introduce dma_readv and dma_writev

2016-05-23 Thread Paolo Bonzini
These are replacements for blk_aio_preadv and blk_aio_pwritev that allow customization of the data path. They reuse the DMA helpers' DMAIOFunc callback type, so that the same function can be used in either the QEMUSGList or the bounce-buffered case. This customization will be needed in the next

[Qemu-block] [PATCH 6/7] scsi-disk: introduce scsi_disk_req_check_error

2016-05-23 Thread Paolo Bonzini
Commonize all the checks for canceled requests and errors. The next patch will add another case to check for, in order to handle passthrough commands. There is no semantic change here; the only nontrivial modification is in scsi_write_do_fua, where cancellation has been checked earlier by both

[Qemu-block] [PATCH 2/7] dma-helpers: change BlockBackend to opaque value in DMAIOFunc

2016-05-23 Thread Paolo Bonzini
Callers of dma_blk_io have no way to pass extra data to the DMAIOFunc, because the original callback and opaque are gone by the time DMAIOFunc is called. On the other hand, the BlockBackend is usually derived from those extra data that you could pass to the DMAIOFunc (in the next patch, that

[Qemu-block] [PATCH 3/7] scsi-disk: introduce a common base class

2016-05-23 Thread Paolo Bonzini
This will be the place to add DMAIOFuncs in the next patch. There are also a couple DeviceClass members that can be moved to the abstract class's initialization function. Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-disk.c | 36 ++-- 1 file

[Qemu-block] [PATCH v2 0/7] dma-helpers, scsi-block: use SG_IO for all I/O on scsi-block

2016-05-23 Thread Paolo Bonzini
scsi-block uses the block layer for reads and writes in order to avoid allocating bounce buffers as big as the transferred data. We know how to split a large transfer to multiple reads and writes, and thus we can use scsi-disk.c's existing code to do I/O in multiple chunks (for non-s/g SCSI

[Qemu-block] [PATCH 5/7] scsi-disk: add need_fua_emulation to SCSIDiskClass

2016-05-23 Thread Paolo Bonzini
scsi-block will be able to do FUA just by passing the request through to the LUN (which is also more efficient); there is no need to emulate it like we do for scsi-disk. Add a new method to distinguish this. Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-disk.c | 9

Re: [Qemu-block] [PATCH v4 0/9] blockdev: (Nearly) free clean-up work

2016-05-23 Thread Kevin Wolf
Am 17.05.2016 um 16:41 hat Max Reitz geschrieben: > After a lot has been restructed in the block layer in the past, we can > now reap at least one of the fruits: Make bdrv_open() return a BDS! Thanks, applied to the block branch. Kevin