Re: [Qemu-block] [PATCH v5 0/4] block: ignore flush requests when storage is clean

2016-07-04 Thread Evgeny Yakovlev
On 04.07.2016 17:53, Paolo Bonzini wrote: On 04/07/2016 16:38, Denis V. Lunev wrote: Changes from v4: - Moved to write generation scheme instead of dirty flag - Added retry setup to IDE PIO and FLUSH requests Changes from v3: - Fixed a typo in commit message - Rebased on Kevin'n origin/block

[Qemu-block] [PATCH 2/3] test-coroutine: prepare for the next patch

2016-07-04 Thread Paolo Bonzini
The next patch moves the coroutine argument from first-enter to creation time. In this case, coroutine has not been initialized yet when the coroutine is created, so change to a pointer. Signed-off-by: Paolo Bonzini --- tests/test-coroutine.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deleti

[Qemu-block] [PATCH 3/3] coroutine: move entry argument to qemu_coroutine_create

2016-07-04 Thread Paolo Bonzini
In practice the entry argument is always known at creation time, and it is confusing that sometimes qemu_coroutine_enter is used with a non-NULL argument to re-enter a coroutine (this happens in block/sheepdog.c and tests/test-coroutine.c). So pass the opaque value at creation time, for consistenc

[Qemu-block] [PATCH for-2.7? 0/3] Two coroutine tweaks

2016-07-04 Thread Paolo Bonzini
Hi, I meant to send these close to soft freeze because the final patch is prone to conflicts, but it turns out I didn't send them. Still they're pretty mechanical so I'm shooting them out now. Any thoughts? Thanks, Paolo Paolo Bonzini (3): coroutine: use QSIMPLEQ instead of QTAILQ test-co

[Qemu-block] [PATCH 1/3] coroutine: use QSIMPLEQ instead of QTAILQ

2016-07-04 Thread Paolo Bonzini
CoQueue do not need to remove any element but the head of the list; processing is always strictly FIFO. Therefore, the simpler singly-linked QSIMPLEQ can be used instead. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- include/qemu/coroutine.h | 2 +- include/qemu/coroutine_

[Qemu-block] [PULL 32/36] megasas: remove unnecessary megasas_use_msi()

2016-07-04 Thread Michael S. Tsirkin
From: Cao jin megasas overwrites user configuration when msi_init fail to flag internal msi state, which is unsuitable. megasa_use_msi() is unnecessary, we can call msi_uninit() directly when unrealize, even no need to call msi_enabled() first. cc: Hannes Reinecke cc: Paolo Bonzini cc: Markus

[Qemu-block] [PULL 31/36] pci: Convert msi_init() to Error and fix callers to check it

2016-07-04 Thread Michael S. Tsirkin
From: Cao jin msi_init() reports errors with error_report(), which is wrong when it's used in realize(). Fix by converting it to Error. Fix its callers to handle failure instead of ignoring it. For those callers who don't handle the failure, it might happen: when user want msi on, but he doesn

[Qemu-block] [PULL 29/36] megasas: change msi/msix property type

2016-07-04 Thread Michael S. Tsirkin
From: Cao jin >From bit to enum OnOffAuto. cc: Hannes Reinecke cc: Paolo Bonzini cc: Michael S. Tsirkin cc: Markus Armbruster cc: Marcel Apfelbaum Reviewed-by: Markus Armbruster Signed-off-by: Cao jin Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Hannes

[Qemu-block] [PATCH for 2.7 resend] linux-aio: share one LinuxAioState within an AioContext

2016-07-04 Thread Paolo Bonzini
This has better performance because it executes fewer system calls and does not use a bottom half per disk. Originally proposed by Ming Lei. Acked-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- async.c| 23 +++ block/linux-aio.c | 10 ++-

Re: [Qemu-block] [PATCH v3 00/11] Allow creating block jobs with a user-defined ID

2016-07-04 Thread Kevin Wolf
Am 01.07.2016 um 17:51 hat Alberto Garcia geschrieben: > Hi all, > > block jobs are currently identified by the name of the block backend > of the BDS where the job was started. > > The problem with this is that you cannot have block jobs on nodes > where there is no such name. > > This series t

Re: [Qemu-block] [PATCH v5 0/4] block: ignore flush requests when storage is clean

2016-07-04 Thread Paolo Bonzini
On 04/07/2016 16:38, Denis V. Lunev wrote: > Changes from v4: > - Moved to write generation scheme instead of dirty flag > - Added retry setup to IDE PIO and FLUSH requests > > Changes from v3: > - Fixed a typo in commit message > - Rebased on Kevin'n origin/block > > Changes from v2: > - Better

[Qemu-block] [PATCH v5 3/4] tests: in IDE and AHCI tests perform DMA write before flushing

2016-07-04 Thread Denis V. Lunev
From: Evgeny Yakovlev Due to changes in flush behaviour clean disks stopped generating flush_to_disk events and IDE and AHCI tests that test flush commands started to fail. This change adds additional DMA writes to affected tests before sending flush commands so that bdrv_flush actually generate

[Qemu-block] [PATCH v5 2/4] ide: set retry_unit for PIO and FLUSH requests

2016-07-04 Thread Denis V. Lunev
From: Evgeny Yakovlev The following sequence of tests discovered a problem in IDE emulation: 1. Send DMA write to IDE device 0 2. Send CMD_FLUSH_CACHE to same IDE device which will be failed by block layer using blkdebug script in tests/ide-test:test_retry_flush When doing DMA request ide/core.c

[Qemu-block] [PATCH v5 0/4] block: ignore flush requests when storage is clean

2016-07-04 Thread Denis V. Lunev
Changes from v4: - Moved to write generation scheme instead of dirty flag - Added retry setup to IDE PIO and FLUSH requests Changes from v3: - Fixed a typo in commit message - Rebased on Kevin'n origin/block Changes from v2: - Better comments - Rebased on latest master Changes from v1: - Flush r

[Qemu-block] [PATCH v5 4/4] block: ignore flush requests when storage is clean

2016-07-04 Thread Denis V. Lunev
From: Evgeny Yakovlev Some guests (win2008 server for example) do a lot of unnecessary flushing when underlying media has not changed. This adds additional overhead on host when calling fsync/fdatasync. This change introduces a write generation scheme in BlockDriverState. Current write generatio

[Qemu-block] [PATCH v5 1/4] ide: refactor retry_unit set and clear into separate function

2016-07-04 Thread Denis V. Lunev
From: Evgeny Yakovlev Code to set and clear state associated with retry in moved into ide_set_retry and ide_clear_retry to make adding retry setups easier. Signed-off-by: Evgeny Yakovlev Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Max Reitz CC: Stefan Hajnoczi CC: Fam Zheng CC: John S

Re: [Qemu-block] [PATCH 1/1] Improve block job rate limiting for small bandwidth values

2016-07-04 Thread Sascha Silbe
Dear Max, Max Reitz writes: > On 28.06.2016 17:28, Sascha Silbe wrote: [block/mirror.c] >> @@ -416,7 +416,9 @@ static uint64_t coroutine_fn >> mirror_iteration(MirrorBlockJob *s) >> assert(io_sectors); >> sector_num += io_sectors; >> nb_chunks -= DIV_ROUND_UP(io_secto

Re: [Qemu-block] [Qemu-devel] [PATCH v3 04/11] block: Use block_job_get() in find_block_job()

2016-07-04 Thread Daniel P. Berrange
On Mon, Jul 04, 2016 at 03:23:14PM +0200, Kevin Wolf wrote: > Am 02.07.2016 um 16:02 hat Max Reitz geschrieben: > > On 01.07.2016 17:52, Alberto Garcia wrote: > > > find_block_job() looks for a block backend with a specified name, > > > checks whether it has a block job and acquires its AioContext.

Re: [Qemu-block] [PATCH v3 04/11] block: Use block_job_get() in find_block_job()

2016-07-04 Thread Alberto Garcia
On Sat 02 Jul 2016 04:02:11 PM CEST, Max Reitz wrote: >> +/* Get a block job using its ID and acquire its AioContext */ >> +static BlockJob *find_block_job(const char *id, AioContext **aio_context, >> Error **errp) >> { >> -BlockBackend *blk; >> -BlockDrive

[Qemu-block] [PATCH 1/1] qemu-img: fix failed autotests

2016-07-04 Thread Denis V. Lunev
There are 9 iotests failed on Ubuntu 15.10 at the moment. The problem is that options parsing in qemu-img is broken by the following commit: commit 10985131e337a0c52c5bd1e191fd7867a6ff8d02 Author: Denis V. Lunev Date: Fri Jun 17 17:44:13 2016 +0300 qemu-img: move common options p

Re: [Qemu-block] [PATCH v3 10/11] qemu-img: Set the ID of the block job in img_commit()

2016-07-04 Thread Alberto Garcia
On Sat 02 Jul 2016 04:21:33 PM CEST, Max Reitz wrote: > On 01.07.2016 17:52, Alberto Garcia wrote: >> img_commit() creates a block job without an ID. This is no longer >> allowed now that we require it to be unique and well-formed. We were >> solving this by having a fallback in block_job_create(),

Re: [Qemu-block] [PATCH v3 04/11] block: Use block_job_get() in find_block_job()

2016-07-04 Thread Kevin Wolf
Am 02.07.2016 um 16:02 hat Max Reitz geschrieben: > On 01.07.2016 17:52, Alberto Garcia wrote: > > find_block_job() looks for a block backend with a specified name, > > checks whether it has a block job and acquires its AioContext. > > > > We want to identify jobs by their ID and not by the block

[Qemu-block] [PATCH v5 10/15] block: simplify drive-backup

2016-07-04 Thread Denis V. Lunev
From: Pavel Butsykin Now that we can support boxed commands, use it to greatly reduce the number of parameters (and likelihood of getting out of sync) when adjusting drive-backup parameters. Signed-off-by: Pavel Butsykin Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Markus Armbruster CC: E

[Qemu-block] [PATCH v5 14/15] qemu-iotests: test backup compression in 055

2016-07-04 Thread Denis V. Lunev
From: Pavel Butsykin Added cases to check the backup compression out of qcow2, raw in qcow2 on drive-backup and blockdev-backup. Signed-off-by: Pavel Butsykin Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Markus Armbruster CC: Eric Blake CC: John Snow CC: Stefan Hajnoczi CC: Kevin Wolf

[Qemu-block] [PATCH v5 12/15] drive-backup: added support for data compression

2016-07-04 Thread Denis V. Lunev
From: Pavel Butsykin The idea is simple - backup is "written-once" data. It is written block by block and it is large enough. It would be nice to save storage space and compress it. The patch adds a flag to the qmp/hmp drive-backup command which enables block compression. Compression should be i

[Qemu-block] [PATCH v5 15/15] qemu-iotests: add vmdk for test backup compression in 055

2016-07-04 Thread Denis V. Lunev
From: Pavel Butsykin The vmdk format has support for compression, it would be fine to add it for the test backup compression. Signed-off-by: Pavel Butsykin Reviewed-by: Stefan Hajnoczi Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Markus Armbruster CC: Eric Blake CC: John Snow CC: Stefa

[Qemu-block] [PATCH v5 02/15] block/io: reuse bdrv_co_pwritev() for write compressed

2016-07-04 Thread Denis V. Lunev
From: Pavel Butsykin For bdrv_pwrite_compressed() it looks like most of the code creating coroutine is duplicated in bdrv_prwv_co(). So we can just add a flag (BDRV_REQ_WRITE_COMPRESSED) and use bdrv_prwv_co() as a generic one. In the end we get coroutine oriented function for write compressed by

[Qemu-block] [PATCH v5 08/15] block: remove BlockDriver.bdrv_write_compressed

2016-07-04 Thread Denis V. Lunev
From: Pavel Butsykin There are no block drivers left that implement the old .bdrv_write_compressed interface, so it can be removed. Also now we have no need to use the bdrv_pwrite_compressed function and we can remove it entirely. Signed-off-by: Pavel Butsykin Signed-off-by: Denis V. Lunev CC:

[Qemu-block] [PATCH v5 00/15] backup compression

2016-07-04 Thread Denis V. Lunev
The idea is simple - backup is "written-once" data. It is written block by block and it is large enough. It would be nice to save storage space and compress it. These patches add the ability to compress data during backup. This functionality is implemented by means of adding options to the qmp/hmp

[Qemu-block] [PATCH v5 11/15] block: simplify blockdev-backup

2016-07-04 Thread Denis V. Lunev
From: Pavel Butsykin Now that we can support boxed commands, use it to greatly reduce the number of parameters (and likelihood of getting out of sync) when adjusting blockdev-backup parameters. Signed-off-by: Pavel Butsykin Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Markus Armbruster CC

[Qemu-block] [PATCH v5 13/15] blockdev-backup: added support for data compression

2016-07-04 Thread Denis V. Lunev
From: Pavel Butsykin The idea is simple - backup is "written-once" data. It is written block by block and it is large enough. It would be nice to save storage space and compress it. Signed-off-by: Pavel Butsykin Reviewed-by: Stefan Hajnoczi Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Mar

[Qemu-block] [PATCH v5 05/15] vmdk: add vmdk_co_pwritev_compressed

2016-07-04 Thread Denis V. Lunev
From: Pavel Butsykin Added implementation of the vmdk_co_pwritev_compressed function that will allow us to safely use compressed writes for the vmdk from running VMs. Signed-off-by: Pavel Butsykin Reviewed-by: Stefan Hajnoczi Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Markus Armbruster

[Qemu-block] [PATCH v5 04/15] qcow2: cleanup qcow2_co_pwritev_compressed to avoid the recursion

2016-07-04 Thread Denis V. Lunev
From: Pavel Butsykin Since the function became use a vector instead of a buffer there is no sense to use a recursive code. Signed-off-by: Pavel Butsykin Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Markus Armbruster CC: Eric Blake CC: John Snow CC: Stefan Hajnoczi CC: Kevin Wolf ---

[Qemu-block] [PATCH v5 07/15] qcow: cleanup qcow_co_pwritev_compressed to avoid the recursion

2016-07-04 Thread Denis V. Lunev
From: Pavel Butsykin Since the function became use a vector instead of a buffer there is no sense to use a recursive code. Signed-off-by: Pavel Butsykin Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Markus Armbruster CC: Eric Blake CC: John Snow CC: Stefan Hajnoczi CC: Kevin Wolf ---

[Qemu-block] [PATCH v5 01/15] block: switch blk_write_compressed() to byte-based interface

2016-07-04 Thread Denis V. Lunev
From: Pavel Butsykin This is a preparatory patch, which continues the general trend of the transition to the byte-based interfaces. Signed-off-by: Pavel Butsykin Reviewed-by: Stefan Hajnoczi Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Markus Armbruster CC: Eric Blake CC: John Snow CC:

[Qemu-block] [PATCH v5 06/15] qcow: add qcow_co_pwritev_compressed

2016-07-04 Thread Denis V. Lunev
From: Pavel Butsykin Added implementation of the qcow_co_pwritev_compressed function that will allow us to safely use compressed writes for the qcow from running VMs. Signed-off-by: Pavel Butsykin Reviewed-by: Stefan Hajnoczi Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Markus Armbruster

[Qemu-block] [PATCH v5 09/15] block/io: turn on dirty_bitmaps for the compressed writes

2016-07-04 Thread Denis V. Lunev
From: Pavel Butsykin Previously was added the assert: commit 1755da16e32c15b22a521e8a38539e4b5cf367f3 Author: Paolo Bonzini Date: Thu Oct 18 16:49:18 2012 +0200 block: introduce new dirty bitmap functionality Now the compressed write is always in coroutine and setting the bits is don

[Qemu-block] [PATCH v5 03/15] qcow2: add qcow2_co_pwritev_compressed

2016-07-04 Thread Denis V. Lunev
From: Pavel Butsykin Added implementation of the qcow2_co_pwritev_compressed function that will allow us to safely use compressed writes for the qcow2 from running VMs. Signed-off-by: Pavel Butsykin Reviewed-by: Stefan Hajnoczi Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Markus Armbruste

Re: [Qemu-block] [PATCH] quorum: Only compile when supported

2016-07-04 Thread Alberto Garcia
On Sat 02 Jul 2016 02:36:38 PM CEST, Max Reitz wrote: >> This was the only exceptional module init function that does >> something else than a simple list of bdrv_register() calls, in all >> the block drivers. > > This sounds like this patch specifically wants to drop the check from > bdrv_quorum_

Re: [Qemu-block] [PATCH v2 6/6] block: Remove BB options from blockdev-add

2016-07-04 Thread Kevin Wolf
Am 02.07.2016 um 18:28 hat Max Reitz geschrieben: > On 30.06.2016 16:13, Kevin Wolf wrote: > > werror/rerror are now available as qdev options. The stats-* options are > > removed without an existing replacement; they should probably be > > configurable with a separate QMP command like I/O throttli

Re: [Qemu-block] [PATCH v2 1/6] block/qdev: Allow node name for drive properties

2016-07-04 Thread Kevin Wolf
Am 02.07.2016 um 17:33 hat Max Reitz geschrieben: > On 30.06.2016 16:13, Kevin Wolf wrote: > > If a node name instead of a BlockBackend name is specified as the driver > > for a guest device, an anonymous BlockBackend is created now. > > > > Signed-off-by: Kevin Wolf > > --- > > hw/core/qdev-pro

Re: [Qemu-block] [PATCH v2 5/6] qemu-iotests: Test setting WCE with qdev

2016-07-04 Thread Kevin Wolf
Am 02.07.2016 um 18:15 hat Max Reitz geschrieben: > On 30.06.2016 16:13, Kevin Wolf wrote: > > +echo "info block" \ > > +| run_qemu -drive "$drive,cache=$cache" \ > > + -device "ide-hd,drive=none0$wce" \ > > +| grep -e "Testing" -e "Cache mode"