Re: [Qemu-block] [PATCH v6 2/4] qcow2: add option to clean unused cache entries after some time

2015-07-08 Thread Kevin Wolf
Am 05.06.2015 um 18:27 hat Alberto Garcia geschrieben: This adds a new 'cache-clean-interval' option that cleans all qcow2 cache entries that haven't been used in a certain interval, given in seconds. This allows setting a large L2 cache size so it can handle scenarios with lots of I/O and

Re: [Qemu-block] [PATCH 1/2] block: vpc - prevent overflow if max_table_entries = 0x40000000

2015-07-08 Thread Kevin Wolf
Am 26.06.2015 um 11:57 hat Stefan Hajnoczi geschrieben: On Thu, Jun 25, 2015 at 11:05:20AM -0400, Jeff Cody wrote: On Thu, Jun 25, 2015 at 03:28:35PM +0100, Stefan Hajnoczi wrote: On Wed, Jun 24, 2015 at 03:54:27PM -0400, Jeff Cody wrote: @@ -269,7 +270,9 @@ static int

Re: [Qemu-block] [Qemu-devel] [PATCH v2] block/curl: Don't lose original error when a connection fails.

2015-07-08 Thread Richard W.M. Jones
On Wed, Jul 08, 2015 at 02:01:30PM +0200, Kevin Wolf wrote: The guest can't cause it, but once the connection is down, I expect every request to fail. You don't have to have a malicious guest for filling up the log file, it just needs to be careless enough to continue trying new requests

Re: [Qemu-block] [Qemu-devel] [PATCH RFC 4/4] aio-posix: Use epoll in aio_poll

2015-07-08 Thread Stefan Hajnoczi
On Wed, Jul 08, 2015 at 09:01:27AM +0800, Fam Zheng wrote: On Tue, 07/07 16:08, Stefan Hajnoczi wrote: +#define EPOLL_BATCH 128 +static bool aio_poll_epoll(AioContext *ctx, bool blocking) +{ +AioHandler *node; +bool was_dispatching; +int i, ret; +bool

Re: [Qemu-block] [PATCH] raw-posix.c: remove raw device access for cdrom

2015-07-08 Thread Kevin Wolf
Am 08.07.2015 um 12:47 hat Laurent Vivier geschrieben: On 08/07/2015 12:31, Kevin Wolf wrote: Am 02.07.2015 um 16:18 hat Laurent Vivier geschrieben: On 02/07/2015 16:03, Paolo Bonzini wrote: On 02/07/2015 15:58, Laurent Vivier wrote: Since any /dev entry can be treated as a

Re: [Qemu-block] [PATCH RFC 3/4] aio: Introduce aio_context_setup

2015-07-08 Thread Stefan Hajnoczi
On Wed, Jul 08, 2015 at 09:15:57AM +0800, Fam Zheng wrote: On Tue, 07/07 15:35, Stefan Hajnoczi wrote: On Tue, Jun 30, 2015 at 09:19:44PM +0800, Fam Zheng wrote: diff --git a/async.c b/async.c index 06971f4..1d70cfd 100644 --- a/async.c +++ b/async.c @@ -290,12 +290,17 @@

Re: [Qemu-block] [PATCH] raw-posix.c: remove raw device access for cdrom

2015-07-08 Thread Kevin Wolf
Am 02.07.2015 um 16:18 hat Laurent Vivier geschrieben: On 02/07/2015 16:03, Paolo Bonzini wrote: On 02/07/2015 15:58, Laurent Vivier wrote: Since any /dev entry can be treated as a raw disk image, it is worth noting which devices can be accessed when and how. /dev/rdisk nodes are

[Qemu-block] [PULL v2 02/16] Revert dataplane: allow virtio-1 devices

2015-07-08 Thread Michael S. Tsirkin
From: Cornelia Huck cornelia.h...@de.ibm.com This reverts commit f5a5628cf0b65b223fa0c9031714578dfac4cf04. This was an old patch that had been already superseded by b0e5d90eb (dataplane: endianness-aware accesses). Signed-off-by: Cornelia Huck cornelia.h...@de.ibm.com Reviewed-by: Michael S.

Re: [Qemu-block] NVMe volatile write cache fixes

2015-07-08 Thread Kevin Wolf
Am 11.06.2015 um 12:01 hat Christoph Hellwig geschrieben: The first patch ensures that flush actually flushes data so that data integrity is preserved, the second fixe up WCE reporting. Thanks, applied to the block branch for 2.4-rc1. Kevin

Re: [Qemu-block] [Qemu-devel] [PATCH RFC 0/4] aio: Use epoll_wait in aio_poll

2015-07-08 Thread Christian Borntraeger
Am 08.07.2015 um 03:02 schrieb Fam Zheng: On Tue, 07/07 16:54, Christian Borntraeger wrote: Am 30.06.2015 um 15:19 schrieb Fam Zheng: epoll is more scalable than ppoll. It performs faster than ppoll when the number of polled fds is high. See patch 4 for an example of the senario and some

[Qemu-block] [PATCH v4] block/curl: Don't lose original error when a connection fails.

2015-07-08 Thread Richard W.M. Jones
Currently if qemu is connected to a curl source (eg. web server), and the web server fails / times out / dies, you always see a bogus EIO Input/output error. For example, choose a large file located on any local webserver which you control: $ qemu-img convert -p http://example.com/large.iso

[Qemu-block] [PATCH v3 2/2] block/curl: Don't lose original error when a connection fails.

2015-07-08 Thread Richard W.M. Jones
Currently if qemu is connected to a curl source (eg. web server), and the web server fails / times out / dies, you always see a bogus EIO Input/output error. For example, choose a large file located on any local webserver which you control: $ qemu-img convert -p http://example.com/large.iso

[Qemu-block] [PATCH v3 1/2] Add a simple mechanism to protect against error message floods.

2015-07-08 Thread Richard W.M. Jones
You can now write code like this: FLOOD_COUNTER(errcount, 100); ... NO_FLOOD(errcount, error_report(oops, something bad happened), error_report(further errors suppressed)); which would print the oops, ... error message up to 100 times, followed by the further errors

Re: [Qemu-block] [PATCH v3 1/2] Add a simple mechanism to protect against error message floods.

2015-07-08 Thread Kevin Wolf
Am 08.07.2015 um 14:50 hat Richard W.M. Jones geschrieben: You can now write code like this: FLOOD_COUNTER(errcount, 100); ... NO_FLOOD(errcount, error_report(oops, something bad happened), error_report(further errors suppressed)); which would print the oops,

Re: [Qemu-block] [PATCH] raw-posix.c: remove raw device access for cdrom

2015-07-08 Thread Programmingkid
On Jul 8, 2015, at 7:01 AM, Kevin Wolf wrote: Am 08.07.2015 um 12:47 hat Laurent Vivier geschrieben: On 08/07/2015 12:31, Kevin Wolf wrote: Am 02.07.2015 um 16:18 hat Laurent Vivier geschrieben: On 02/07/2015 16:03, Paolo Bonzini wrote: On 02/07/2015 15:58, Laurent Vivier wrote:

[Qemu-block] [PATCH for-2.5 2/4] block-backend: add blk_get_max_iov()

2015-07-08 Thread Stefan Hajnoczi
Add a function to query BlockLimits.max_iov. Signed-off-by: Stefan Hajnoczi stefa...@redhat.com --- block/block-backend.c | 5 + include/sysemu/block-backend.h | 1 + 2 files changed, 6 insertions(+) diff --git a/block/block-backend.c b/block/block-backend.c index aee8a12..5108aec

[Qemu-block] [PATCH for-2.5 1/4] block: add BlockLimits.max_iov field

2015-07-08 Thread Stefan Hajnoczi
The maximum number of struct iovec elements depends on the BlockDriverState. The raw-posix protocol has a maximum of IOV_MAX but others could have different values. Instead of assuming raw-posix and hardcoding IOV_MAX in several places, put the limit into BlockLimits. Cc: Peter Lieven

[Qemu-block] [PATCH for-2.5 4/4] block/mirror: replace IOV_MAX with blk_get_max_iov()

2015-07-08 Thread Stefan Hajnoczi
Use blk_get_max_iov() instead of hardcoding IOV_MAX, which may not apply to all BlockDrivers. Signed-off-by: Stefan Hajnoczi stefa...@redhat.com --- block/mirror.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index 985ad00..0f4445c

[Qemu-block] [PATCH for-2.5 3/4] block: replace IOV_MAX with BlockLimits.max_iov

2015-07-08 Thread Stefan Hajnoczi
Request merging must not result in a huge request that exceeds the maximum number of iovec elements. Use BlockLimits.max_iov instead of hardcoding IOV_MAX. Signed-off-by: Stefan Hajnoczi stefa...@redhat.com --- block/io.c| 3 ++- hw/block/virtio-blk.c | 2 +- 2 files changed, 3

[Qemu-block] [PATCH 1/2] ignore bdrv_flush operation when no qcow2 cache item is dirty

2015-07-08 Thread Qingshu Chen
qcow2_cache_flush() writes dirty cache to the disk and invokes bdrv_flush() to make the data durable. But even if there is no dirty cache, qcow2_cache_flush() would invoke bdrv_flush(). In fact, bdrv_flush() will invoke fdatasync(), and it is an expensive operation. The patch will not invoke

[Qemu-block] [PATCH for-2.4 4/5] block: Reorder cleanups in bdrv_close()

2015-07-08 Thread Kevin Wolf
Block drivers may still want to access their child nodes in their .bdrv_close handler. If they unref and/or detach a child by themselves, this should not result in a double free. There is additional code for backing files, which are just a special case of child nodes. The same applies for them.

[Qemu-block] [PATCH for-2.4 5/5] block: Fix backing file child when modifying graph

2015-07-08 Thread Kevin Wolf
This patch moves bdrv_attach_child() from the individual places that add a backing file to a BDS to bdrv_set_backing_hd(), which is called by all of them. It also adds bdrv_detach_child() there. For normal operation (starting with one backing file chain and not changing it until the topmost image

[Qemu-block] [PATCH 3/3] mirror: Speed up bitmap initial scanning

2015-07-08 Thread Fam Zheng
Limiting to sectors_per_chunk for each bdrv_is_allocated_above is slow, because the underlying protocol driver would issue much more queries than necessary. We should coalesce the query. Signed-off-by: Fam Zheng f...@redhat.com --- block/mirror.c | 15 ++- 1 file changed, 6

[Qemu-block] [PATCH 2/3] mirror: Use block_job_relax_cpu during bitmap scanning

2015-07-08 Thread Fam Zheng
Sleeping for 0 second may not be as effective as we want, use block_job_relax_cpu. Signed-off-by: Fam Zheng f...@redhat.com --- block/mirror.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/mirror.c b/block/mirror.c index 62db031..ca55578 100644 --- a/block/mirror.c

Re: [Qemu-block] [PATCH COLO-BLOCK v8 09/18] Backup: clear all bitmap when doing block checkpoint

2015-07-08 Thread Dr. David Alan Gilbert
* Wen Congyang (we...@cn.fujitsu.com) wrote: Signed-off-by: Wen Congyang we...@cn.fujitsu.com Signed-off-by: zhanghailiang zhang.zhanghaili...@huawei.com Signed-off-by: Gonglei arei.gong...@huawei.com Cc: Jeff Cody jc...@redhat.com --- block/backup.c | 13 +

Re: [Qemu-block] [Qemu-devel] [PATCH COLO-BLOCK v7 00/17] Block replication for continuous checkpoints

2015-07-08 Thread Dr. David Alan Gilbert
* Wen Congyang (we...@cn.fujitsu.com) wrote: On 07/08/2015 11:49 PM, Michael R. Hines wrote: On 07/07/2015 08:38 PM, Wen Congyang wrote: On 07/08/2015 12:56 AM, Michael R. Hines wrote: On 07/07/2015 04:23 AM, Paolo Bonzini wrote: On 07/07/2015 11:13, Dr. David Alan Gilbert wrote: This

[Qemu-block] [PATCH 0/3] mirror: Fix guest responsiveness during bitmap scan

2015-07-08 Thread Fam Zheng
This supersedes: http://patchwork.ozlabs.org/patch/491415/ and [1] which is currently in Jeff's tree. Although [1] fixed the QMP responsiveness, Alexandre DERUMIER reported that guest responsiveness still suffers when we are busy in the initial dirty bitmap scanning loop of mirror job. That is

Re: [Qemu-block] [Qemu-devel] [PATCH COLO-BLOCK v7 00/17] Block replication for continuous checkpoints

2015-07-08 Thread Wen Congyang
On 07/09/2015 09:55 AM, Dr. David Alan Gilbert wrote: * Wen Congyang (we...@cn.fujitsu.com) wrote: On 07/08/2015 11:49 PM, Michael R. Hines wrote: On 07/07/2015 08:38 PM, Wen Congyang wrote: On 07/08/2015 12:56 AM, Michael R. Hines wrote: On 07/07/2015 04:23 AM, Paolo Bonzini wrote: On

Re: [Qemu-block] [Qemu-devel] [PATCH COLO-BLOCK v7 00/17] Block replication for continuous checkpoints

2015-07-08 Thread Wen Congyang
On 07/08/2015 11:49 PM, Michael R. Hines wrote: On 07/07/2015 08:38 PM, Wen Congyang wrote: On 07/08/2015 12:56 AM, Michael R. Hines wrote: On 07/07/2015 04:23 AM, Paolo Bonzini wrote: On 07/07/2015 11:13, Dr. David Alan Gilbert wrote: This log is very stange. The NBD client connects to NBD

Re: [Qemu-block] [PATCH COLO-BLOCK v8 09/18] Backup: clear all bitmap when doing block checkpoint

2015-07-08 Thread Wen Congyang
On 07/09/2015 09:28 AM, Dr. David Alan Gilbert wrote: * Wen Congyang (we...@cn.fujitsu.com) wrote: Signed-off-by: Wen Congyang we...@cn.fujitsu.com Signed-off-by: zhanghailiang zhang.zhanghaili...@huawei.com Signed-off-by: Gonglei arei.gong...@huawei.com Cc: Jeff Cody jc...@redhat.com ---

[Qemu-block] [PATCH for-2.4 0/5] block: Fix backing file child when modifying graph

2015-07-08 Thread Kevin Wolf
This series is extracted from my work towards removing bdrv_swap(), which is targeted for 2.5. It contains a fix for dangling pointers when modifying the BDS graph and its dependencies. I didn't bother to split patches of which only a part is required, nor did I remove references to the future

[Qemu-block] [PATCH for-2.4 2/5] block: Introduce bdrv_open_child()

2015-07-08 Thread Kevin Wolf
It is the same as bdrv_open_image(), except that it doesn't only return success or failure, but the newly created BdrvChild object for the new child node. As the BdrvChild object already contains a BlockDriverState pointer (and this is supposed to become the only pointer so that bdrv_append() and