Re: [Qemu-devel] [PATCH v2 1/3] block: add bdrv_co_drain_end callback

2017-09-21 Thread Manos Pitsidianakis
On Thu, Sep 21, 2017 at 09:29:43PM +0800, Fam Zheng wrote: On Thu, 09/21 16:17, Manos Pitsidianakis wrote: BlockDriverState has a bdrv_do_drain() callback but no equivalent for the end s/bdrv_do_drain/bdrv_co_drain/ of the drain. The throttle driver (block/throttle.c) needs a way to mark

Re: [Qemu-devel] [PATCH v2 0/3] add bdrv_co_drain_begin/end BlockDriver callbacks

2017-09-21 Thread Manos Pitsidianakis
On Thu, Sep 21, 2017 at 09:35:35PM +0800, Fam Zheng wrote: On Thu, 09/21 16:17, Manos Pitsidianakis wrote: This patch series renames bdrv_co_drain to bdrv_co_drain_begin and adds a new bdrv_co_drain_end callback to match bdrv_drained_begin/end and drained_begin/end of BdrvChild. This is needed

[Qemu-devel] [PATCH v2 3/3] block/throttle.c: add bdrv_co_drain_begin/end callbacks

2017-09-21 Thread Manos Pitsidianakis
Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block/throttle.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/block/throttle.c b/block/throttle.c index 5bca76300f..833175ac77 100644 --- a/bloc

[Qemu-devel] [PATCH v2 0/3] add bdrv_co_drain_begin/end BlockDriver callbacks

2017-09-21 Thread Manos Pitsidianakis
g for completion [Stefan] Manos Pitsidianakis (3): block: add bdrv_co_drain_end callback block: rename bdrv_co_drain to bdrv_co_drain_begin block/throttle.c: add bdrv_co_drain_begin/end callbacks include/block/block_int.h | 8 +++- block/io.c

[Qemu-devel] [PATCH v2 1/3] block: add bdrv_co_drain_end callback

2017-09-21 Thread Manos Pitsidianakis
BlockDriverState has a bdrv_do_drain() callback but no equivalent for the end of the drain. The throttle driver (block/throttle.c) needs a way to mark the end of the drain in order to toggle io_limits_disabled correctly, thus bdrv_co_drain_end is needed. Signed-off-by: Manos Pitsidianakis <e

[Qemu-devel] [PATCH v2 2/3] block: rename bdrv_co_drain to bdrv_co_drain_begin

2017-09-21 Thread Manos Pitsidianakis
Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- include/block/block_int.h | 2 +- block/io.c| 4 ++-- block/qed.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/i

Re: [Qemu-devel] [PATCH 1/3] block: add bdrv_co_drain_end callback

2017-09-20 Thread Manos Pitsidianakis
On Wed, Sep 20, 2017 at 03:26:32PM +0100, Stefan Hajnoczi wrote: On Wed, Sep 20, 2017 at 01:23:09PM +0300, Manos Pitsidianakis wrote: @@ -188,7 +194,7 @@ static bool bdrv_drain_recurse(BlockDriverState *bs) waited = BDRV_POLL_WHILE(bs, atomic_read(>in_flight) > 0); /* Ensu

Re: [Qemu-devel] [PATCH 1/2] block/block-backend.c: add blk_check_byte_request call to blk_pread/blk_pwrite

2017-09-20 Thread Manos Pitsidianakis
On Wed, Sep 20, 2017 at 02:24:21PM +0200, Kevin Wolf wrote: Am 20.09.2017 um 13:43 hat Manos Pitsidianakis geschrieben: blk_check_byte_request() is called from the blk_co_pwritev/blk_co_preadv to check if the request offset and request bytes parameters are valid for the given Blockbackend

Re: [Qemu-devel] [PATCH v2] throttle-groups: update tg->any_timer_armed[] on detach

2017-09-20 Thread Manos Pitsidianakis
ast since QEMU 2.10.0 with -drive iops=100: $ dd if=/dev/zero of=/dev/vdb oflag=direct count=1000 (qemu) stop (qemu) cont ...I/O is stuck... Reported-by: Yongxue Hong <yh...@redhat.com> Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com> Reviewed-by: Manos Pitsidianakis <el

Re: [Qemu-devel] [PATCH v2] throttle-groups: update tg->any_timer_armed[] on detach

2017-09-20 Thread Manos Pitsidianakis
On Wed, Sep 20, 2017 at 01:08:52PM +0200, Alberto Garcia wrote: On Wed 20 Sep 2017 12:17:40 PM CEST, Stefan Hajnoczi wrote: @@ -592,6 +592,17 @@ void throttle_group_attach_aio_context(ThrottleGroupMember *tgm, void throttle_group_detach_aio_context(ThrottleGroupMember *tgm) {

[Qemu-devel] [PATCH 0/2] remove blk_pread_unthrottled()

2017-09-20 Thread Manos Pitsidianakis
Cleanups for minor stuff I noticed while looking around blk_root_drained_* Manos Pitsidianakis (2): block/block-backend.c: add blk_check_byte_request call to blk_pread/blk_pwrite block/block-backend.c: remove blk_pread_unthrottled() include/sysemu/block-backend.h | 2 -- block/block

[Qemu-devel] [PATCH 2/2] block/block-backend.c: remove blk_pread_unthrottled()

2017-09-20 Thread Manos Pitsidianakis
blk_pread_unthrottled was used to bypass I/O throttling on the BlockBackend in the case of async I/O. This is not needed anymore and we can just call blk_pread() directly. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- include/sysemu/block-backend.h | 2 -- block/block-bac

[Qemu-devel] [PATCH 3/3] block/throttle.c: add bdrv_co_drain_begin/end callbacks

2017-09-20 Thread Manos Pitsidianakis
Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block/throttle.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/block/throttle.c b/block/throttle.c index 5bca76300f..833175ac77 100644 --- a/block/throttle.c +++ b/block/throttle.c @@ -197,6 +197,21 @@

[Qemu-devel] [PATCH 0/3] add bdrv_co_drain_begin/end BlockDriver callbacks

2017-09-20 Thread Manos Pitsidianakis
io_limits_disabled correctly. Based-on: <20170918202529.28379-1-el13...@mail.ntua.gr> "block/throttle-groups.c: allocate RestartData on the heap" Which fixes a coroutine crash in block/throttle-groups.c Manos Pitsidianakis (3): block: add bdrv_co_drain_end callback

[Qemu-devel] [PATCH 2/3] block: rename bdrv_co_drain to bdrv_co_drain_begin

2017-09-20 Thread Manos Pitsidianakis
Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- include/block/block_int.h | 2 +- block/io.c| 4 ++-- block/qed.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h

[Qemu-devel] [PATCH 1/2] block/block-backend.c: add blk_check_byte_request call to blk_pread/blk_pwrite

2017-09-20 Thread Manos Pitsidianakis
blk_check_byte_request() is called from the blk_co_pwritev/blk_co_preadv to check if the request offset and request bytes parameters are valid for the given Blockbackend. Let's do that in blk_pread/blk_pwrite too. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block

[Qemu-devel] [PATCH 1/3] block: add bdrv_co_drain_end callback

2017-09-20 Thread Manos Pitsidianakis
BlockDriverState has a bdrv_do_drain() callback but no equivalent for the end of the drain. The throttle driver (block/throttle.c) needs a way to mark the end of the drain in order to toggle io_limits_disabled correctly, thus bdrv_co_drain_end is needed. Signed-off-by: Manos Pitsidianakis <e

[Qemu-devel] [PATCH] block/throttle-groups.c: allocate RestartData on the heap

2017-09-18 Thread Manos Pitsidianakis
RestartData is the opaque data of the throttle_group_restart_queue_entry coroutine. By being stack allocated, it isn't available anymore if aio_co_enter schedules the coroutine with a bottom halve and runs after throttle_group_restart_queue returns. Signed-off-by: Manos Pitsidianakis <e

Re: [Qemu-devel] [PATCH v11 2/6] qmp: Use ThrottleLimits structure

2017-09-18 Thread Manos Pitsidianakis
On Thu, Sep 14, 2017 at 06:40:06AM -0400, Pradeep Jagadeesh wrote: This patch factors out code to use the ThrottleLimits strurcture. Signed-off-by: Pradeep Jagadeesh Reviewed-by: Greg Kurz Reviewed-by: Eric Blake Reviewed-by:

Re: [Qemu-devel] [PATCH v11 1/6] throttle: factor out duplicate code

2017-09-18 Thread Manos Pitsidianakis
On Thu, Sep 14, 2017 at 06:40:05AM -0400, Pradeep Jagadeesh wrote: This patch factors out the duplicate throttle code that was still present in block and fsdev devices. Signed-off-by: Pradeep Jagadeesh Reviewed-by: Alberto Garcia Reviewed-by:

Re: [Qemu-devel] [PATCH v11 2/6] qmp: Use ThrottleLimits structure

2017-09-18 Thread Manos Pitsidianakis
On Thu, Sep 14, 2017 at 06:40:06AM -0400, Pradeep Jagadeesh wrote: This patch factors out code to use the ThrottleLimits strurcture. Signed-off-by: Pradeep Jagadeesh Reviewed-by: Greg Kurz Reviewed-by: Eric Blake Reviewed-by:

Re: [Qemu-devel] [PATCH v3 4/7] block: remove legacy I/O throttling

2017-09-08 Thread Manos Pitsidianakis
On Fri, Sep 08, 2017 at 06:00:11PM +0200, Kevin Wolf wrote: Am 08.09.2017 um 17:44 hat Manos Pitsidianakis geschrieben: On Thu, Sep 07, 2017 at 03:26:11PM +0200, Kevin Wolf wrote: > We shouldn't really need any throttling code in > blk_root_drained_begin/end any more now because the th

Re: [Qemu-devel] [PATCH v3 4/7] block: remove legacy I/O throttling

2017-09-08 Thread Manos Pitsidianakis
On Thu, Sep 07, 2017 at 03:26:11PM +0200, Kevin Wolf wrote: We shouldn't really need any throttling code in blk_root_drained_begin/end any more now because the throttle node will be drained. If this code is necessary, a bdrv_drain() on an explicit throttle node will work differently from one on

Re: [Qemu-devel] [Qemu-block] [PATCH v9 6/6] qemu-iotests: add 184 for throttle filter driver

2017-09-06 Thread Manos Pitsidianakis
On Tue, Sep 05, 2017 at 04:13:39PM -0500, Eric Blake wrote: On 09/05/2017 02:06 PM, Kevin Wolf wrote: Am 05.09.2017 um 18:16 hat Kevin Wolf geschrieben: Am 25.08.2017 um 15:20 hat Manos Pitsidianakis geschrieben: Reviewed-by: Alberto Garcia <be...@igalia.com> Signed-off-by:

[Qemu-devel] GSOC Report: Moving I/O throttling and write notifiers into block filter drivers

2017-08-28 Thread Manos Pitsidianakis
This is a GSOC project summary required for the project's final submission. As part of GSOC 2017, I took the project of moving two hard coded block layer features into filter drivers. I/O Throttling is implemented in block/throttle.c and before write notifiers are split into a driver for each

[Qemu-devel] [PATCH v3 4/7] block: remove legacy I/O throttling

2017-08-25 Thread Manos Pitsidianakis
of the device. The legacy throttle node is managed by the legacy interface completely. More advanced configurations with the filter drive are possible using the QMP API, but these will be ignored by the legacy interface. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- include

[Qemu-devel] [PATCH v3 6/7] block: remove BlockBackendPublic

2017-08-25 Thread Manos Pitsidianakis
ed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- include/sysemu/block-backend.h | 12 +--- block/block-backend.c | 43 +++--- block/qapi.c | 4 ++-- blockdev.c | 4 ++-- 4 files changed, 2

[Qemu-devel] [PATCH v3 5/7] block/throttle-groups.c: remove throttle-groups list

2017-08-25 Thread Manos Pitsidianakis
. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- include/block/throttle-groups.h | 1 + block/block-backend.c | 15 +++-- block/throttle-groups.c | 145 +++- tests/test-throttle.c | 3 + 4 files chang

[Qemu-devel] [PATCH v3 1/7] block: skip implicit nodes in snapshots, blockjobs

2017-08-25 Thread Manos Pitsidianakis
graph. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- include/block/block_int.h | 17 + block.c | 10 ++ block/qapi.c | 14 +- blockdev.c| 34 ++ 4 files

[Qemu-devel] [PATCH v3 0/6] block: remove legacy I/O throttling

2017-08-25 Thread Manos Pitsidianakis
ctions add new function to get filter child bs take ownership of options in bdrv_new_open_driver() Manos Pitsidianakis (7): block: skip implicit nodes in snapshots, blockjobs block: add options parameter to bdrv_new_open_driver() block: require job-id when device is a node name block:

[Qemu-devel] [PATCH v3 3/7] block: require job-id when device is a node name

2017-08-25 Thread Manos Pitsidianakis
"sync": "full", "target": "backup.img" } } is not a BlockBackend name, instead of automatically getting it from the root BS if device is a node name. That information is lost after calling block_job_create(), so we can do it in its cal

[Qemu-devel] [PATCH v3 7/7] qemu-iotests: add 191 for legacy throttling interface

2017-08-25 Thread Manos Pitsidianakis
Check that the implicit throttle filter driver node, used for compatibility with the legacy throttling interface on the BlockBackend level, works. Reviewed-by: Alberto Garcia <be...@igalia.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- tests/qemu-iotests/1

[Qemu-devel] [PATCH v3 2/7] block: add options parameter to bdrv_new_open_driver()

2017-08-25 Thread Manos Pitsidianakis
Allow passing a QDict *options parameter to bdrv_new_open_driver() so that it can be used if a driver needs it upon creation. The previous behaviour (empty bs->options and bs->explicit_options) remains when options is NULL. Reviewed-by: Alberto Garcia <be...@igalia.com> Signed-o

[Qemu-devel] [PATCH v9 5/6] block: add throttle block filter driver

2017-08-25 Thread Manos Pitsidianakis
-group=bar which registers the throttle filter node with the ThrottleGroup 'bar'. The given group must be created beforehand with object-add or -object. Reviewed-by: Alberto Garcia <be...@igalia.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- qapi/block-core.json

[Qemu-devel] [PATCH v9 1/6] block: move ThrottleGroup membership to ThrottleGroupMember

2017-08-25 Thread Manos Pitsidianakis
. This is done by gathering ThrottleGroup membership details from BlockBackendPublic into ThrottleGroupMember and refactoring existing code to use the structure. Reviewed-by: Alberto Garcia <be...@igalia.com> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Manos Pitsidi

[Qemu-devel] [PATCH v9 6/6] qemu-iotests: add 184 for throttle filter driver

2017-08-25 Thread Manos Pitsidianakis
Reviewed-by: Alberto Garcia <be...@igalia.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- tests/qemu-iotests/184 | 205 +++ tests/qemu-iotests/184.out | 300 + tests/qemu-iotests/group

[Qemu-devel] [PATCH v9 0/6] add throttle block driver filter

2017-08-25 Thread Manos Pitsidianakis
error in 'add aio_context field in ThrottleGroupMember' v2: change QOM throttle group object name print valid ranges for uint on error move frees in throttle_group_obj_finalize() split throttle_group_{set,get}() add throttle_recurse_is_first_non_filter() Manos Pitsidianakis (6): block

[Qemu-devel] [PATCH v9 4/6] block: convert ThrottleGroup to object with QOM

2017-08-25 Thread Manos Pitsidianakis
o", "props" : { "limits": { "iops-total": 100 } } } } { "execute" : "qom-set", "arguments" : { "path" : "foo", "property" : "limits", "value"

[Qemu-devel] [PATCH v9 2/6] block: add aio_context field in ThrottleGroupMember

2017-08-25 Thread Manos Pitsidianakis
com> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- include/block/throttle-groups.h | 7 - block/block-backend.c | 15 -- block/throttle-groups.c | 38 - tes

[Qemu-devel] [PATCH v9 3/6] block: tidy ThrottleGroupMember initializations

2017-08-25 Thread Manos Pitsidianakis
Move the CoMutex and CoQueue inits inside throttle_group_register_tgm() which is called whenever a ThrottleGroupMember is initialized. There's no need for them to be separate. Reviewed-by: Alberto Garcia <be...@igalia.com> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-o

Re: [Qemu-devel] [PATCH v7 6/6] qemu-iotests: add 184 for throttle filter driver

2017-08-24 Thread Manos Pitsidianakis
On Thu, Aug 24, 2017 at 07:43:08PM +0100, Stefan Hajnoczi wrote: On Tue, Aug 22, 2017 at 01:15:35PM +0300, Manos Pitsidianakis wrote: +_supported_fmt qcow2 What makes this test qcow2-specific? With additional filtering for IMGFMT it should be possible to run this on any image format. I

[Qemu-devel] [PATCH v8 6/6] qemu-iotests: add 184 for throttle filter driver

2017-08-24 Thread Manos Pitsidianakis
Reviewed-by: Alberto Garcia <be...@igalia.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- tests/qemu-iotests/184 | 205 +++ tests/qemu-iotests/184.out | 300 + tests/qemu-iotests/group

[Qemu-devel] [PATCH v8 0/6] add throttle block driver filter

2017-08-24 Thread Manos Pitsidianakis
print valid ranges for uint on error move frees in throttle_group_obj_finalize() split throttle_group_{set,get}() add throttle_recurse_is_first_non_filter() Manos Pitsidianakis (6): block: move ThrottleGroup membership to ThrottleGroupMember block: add aio_context field

[Qemu-devel] [PATCH v8 4/6] block: convert ThrottleGroup to object with QOM

2017-08-24 Thread Manos Pitsidianakis
o", "props" : { "limits": { "iops-total": 100 } } } } { "execute" : "qom-set", "arguments" : { "path" : "foo", "property" : "limits", "value"

[Qemu-devel] [PATCH v8 5/6] block: add throttle block filter driver

2017-08-24 Thread Manos Pitsidianakis
-group=bar which registers the throttle filter node with the ThrottleGroup 'bar'. The given group must be created beforehand with object-add or -object. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- qapi/block-core.json| 18 ++- include/block/throttle-groups.h

[Qemu-devel] [PATCH v8 2/6] block: add aio_context field in ThrottleGroupMember

2017-08-24 Thread Manos Pitsidianakis
com> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- include/block/throttle-groups.h | 7 - block/block-backend.c | 15 -- block/throttle-groups.c | 38 - tes

[Qemu-devel] [PATCH v8 1/6] block: move ThrottleGroup membership to ThrottleGroupMember

2017-08-24 Thread Manos Pitsidianakis
. This is done by gathering ThrottleGroup membership details from BlockBackendPublic into ThrottleGroupMember and refactoring existing code to use the structure. Reviewed-by: Alberto Garcia <be...@igalia.com> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Manos Pitsidi

[Qemu-devel] [PATCH v8 3/6] block: tidy ThrottleGroupMember initializations

2017-08-24 Thread Manos Pitsidianakis
Move the CoMutex and CoQueue inits inside throttle_group_register_tgm() which is called whenever a ThrottleGroupMember is initialized. There's no need for them to be separate. Reviewed-by: Alberto Garcia <be...@igalia.com> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-o

Re: [Qemu-devel] [PATCH v7 5/6] block: add throttle block filter driver

2017-08-22 Thread Manos Pitsidianakis
On Tue, Aug 22, 2017 at 04:16:26PM +0200, Alberto Garcia wrote: On Tue 22 Aug 2017 12:15:34 PM CEST, Manos Pitsidianakis wrote: @@ -548,6 +548,11 @@ void throttle_group_unregister_tgm(ThrottleGroupMember *tgm) ThrottleGroupMember *token; int i; +if (!ts) { +/* Discard

Re: [Qemu-devel] [PATCH v7 4/6] block: convert ThrottleGroup to object with QOM

2017-08-22 Thread Manos Pitsidianakis
On Tue, Aug 22, 2017 at 03:25:41PM +0200, Alberto Garcia wrote: +/* This function edits throttle_groups and must be called under the global + * mutex */ +static void throttle_group_obj_complete(UserCreatable *obj, Error **errp) +{ +ThrottleGroup *tg = THROTTLE_GROUP(obj); +ThrottleConfig

Re: [Qemu-devel] [PATCH v2 3/6] block: require job-id when device is a node name

2017-08-22 Thread Manos Pitsidianakis
On Tue, Aug 22, 2017 at 11:57:28AM +0200, Alberto Garcia wrote: On Mon 21 Aug 2017 05:39:48 PM CEST, Manos Pitsidianakis wrote: -if (job_id == NULL && !(flags & BLOCK_JOB_INTERNAL)) { -job_id = bdrv_get_device_name(bs); -if (!*job_id) { -err

[Qemu-devel] [PATCH v7 4/6] block: convert ThrottleGroup to object with QOM

2017-08-22 Thread Manos Pitsidianakis
o", "props" : { "limits": { "iops-total": 100 } } } } { "execute" : "qom-set", "arguments" : { "path" : "foo", "property" : "limits", "value"

[Qemu-devel] [PATCH v7 5/6] block: add throttle block filter driver

2017-08-22 Thread Manos Pitsidianakis
-group=bar which registers the throttle filter node with the ThrottleGroup 'bar'. The given group must be created beforehand with object-add or -object. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- qapi/block-core.json| 18 ++- include/block/throttle-groups.h

[Qemu-devel] [PATCH v7 2/6] block: add aio_context field in ThrottleGroupMember

2017-08-22 Thread Manos Pitsidianakis
com> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- include/block/throttle-groups.h | 7 - block/block-backend.c | 15 -- block/throttle-groups.c | 38 - tes

[Qemu-devel] [PATCH v7 6/6] qemu-iotests: add 184 for throttle filter driver

2017-08-22 Thread Manos Pitsidianakis
Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- tests/qemu-iotests/184 | 205 +++ tests/qemu-iotests/184.out | 300 + tests/qemu-iotests/group | 1 + 3 files changed, 506 insertions(+) creat

[Qemu-devel] [PATCH v7 3/6] block: tidy ThrottleGroupMember initializations

2017-08-22 Thread Manos Pitsidianakis
Move the CoMutex and CoQueue inits inside throttle_group_register_tgm() which is called whenever a ThrottleGroupMember is initialized. There's no need for them to be separate. Reviewed-by: Alberto Garcia <be...@igalia.com> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-o

[Qemu-devel] [PATCH v7 1/6] block: move ThrottleGroup membership to ThrottleGroupMember

2017-08-22 Thread Manos Pitsidianakis
. This is done by gathering ThrottleGroup membership details from BlockBackendPublic into ThrottleGroupMember and refactoring existing code to use the structure. Reviewed-by: Alberto Garcia <be...@igalia.com> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Manos Pitsidi

[Qemu-devel] [PATCH v7 0/6] add throttle block driver filter

2017-08-22 Thread Manos Pitsidianakis
on error move frees in throttle_group_obj_finalize() split throttle_group_{set,get}() add throttle_recurse_is_first_non_filter() Manos Pitsidianakis (6): block: move ThrottleGroup membership to ThrottleGroupMember block: add aio_context field in ThrottleGroupMember block: tidy

Re: [Qemu-devel] [PATCH v2 3/6] block: require job-id when device is a node name

2017-08-21 Thread Manos Pitsidianakis
On Mon, Aug 21, 2017 at 05:05:30PM +0200, Alberto Garcia wrote: On Wed 09 Aug 2017 04:02:53 PM CEST, Manos Pitsidianakis wrote: @@ -622,20 +622,14 @@ void *block_job_create(const char *job_id, const BlockJobDriver *driver, return NULL; } -if (job_id == NULL &&

Re: [Qemu-devel] [PATCH 3/4] throttle: Remove throttle_fix_bucket() / throttle_unfix_bucket()

2017-08-21 Thread Manos Pitsidianakis
On Mon, Aug 21, 2017 at 02:10:59PM +0200, Alberto Garcia wrote: On Sat 19 Aug 2017 05:23:12 PM CEST, Manos Pitsidianakis wrote: -/* If the bucket is full then we have to wait */ -extra = bkt->level - bkt->max * bkt->burst_length; +if (!bkt->max) { +/* If bkt-

[Qemu-devel] [PATCH v6 3/6] block: tidy ThrottleGroupMember initializations

2017-08-21 Thread Manos Pitsidianakis
Move the CoMutex and CoQueue inits inside throttle_group_register_tgm() which is called whenever a ThrottleGroupMember is initialized. There's no need for them to be separate. Reviewed-by: Alberto Garcia <be...@igalia.com> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-o

[Qemu-devel] [PATCH v6 1/6] block: move ThrottleGroup membership to ThrottleGroupMember

2017-08-21 Thread Manos Pitsidianakis
. This is done by gathering ThrottleGroup membership details from BlockBackendPublic into ThrottleGroupMember and refactoring existing code to use the structure. Reviewed-by: Alberto Garcia <be...@igalia.com> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Manos Pitsidi

[Qemu-devel] [PATCH v6 4/6] block: convert ThrottleGroup to object with QOM

2017-08-21 Thread Manos Pitsidianakis
{ "iops-total" : 99 } } } This also means a group's configuration can be fetched with qom-get. ThrottleGroups can be anonymous which means they can't get accessed by other users ie they will always be units instead of group (Because they have one ThrottleGroupMember

[Qemu-devel] [PATCH v6 5/6] block: add throttle block filter driver

2017-08-21 Thread Manos Pitsidianakis
parameters and their semantics are identical to the hardcoded throttling ones. limits.* cannot be specified at the same time as throttle-group. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- qapi/block-core.json| 22 ++- include/qapi/qmp/qdict.h| 1 + includ

[Qemu-devel] [PATCH v6 6/6] qemu-iotests: add 184 for throttle filter driver

2017-08-21 Thread Manos Pitsidianakis
Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- tests/qemu-iotests/184 | 244 tests/qemu-iotests/184.out | 339 + tests/qemu-iotests/group | 1 + 3 files changed, 584 insertions(+) creat

[Qemu-devel] [PATCH v6 2/6] block: add aio_context field in ThrottleGroupMember

2017-08-21 Thread Manos Pitsidianakis
com> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- include/block/throttle-groups.h | 7 - block/block-backend.c | 15 -- block/throttle-groups.c | 38 - tes

[Qemu-devel] [PATCH v6 0/6] add throttle block driver filter

2017-08-21 Thread Manos Pitsidianakis
: fix style error in 'add aio_context field in ThrottleGroupMember' v2: change QOM throttle group object name print valid ranges for uint on error move frees in throttle_group_obj_finalize() split throttle_group_{set,get}() add throttle_recurse_is_first_non_filter() Manos Pitsidianakis (6

Re: [Qemu-devel] [PATCH 3/4] throttle: Remove throttle_fix_bucket() / throttle_unfix_bucket()

2017-08-19 Thread Manos Pitsidianakis
On Thu, Aug 17, 2017 at 05:28:14PM +0300, Alberto Garcia wrote: The throttling code can change internally the value of bkt->max if it hasn't been set by the user. The problem with this is that if we want to retrieve the original value we have to undo this change first. This is ugly and

Re: [Qemu-devel] [PATCH 4/4] throttle: Make LeakyBucket.avg and LeakyBucket.max integer types

2017-08-19 Thread Manos Pitsidianakis
their value changes depending on the fraction of time elapsed since the previous I/O operation. Signed-off-by: Alberto Garcia <be...@igalia.com> Reviewed-by: Manos Pitsidianakis <el13...@mail.ntua.gr> include/qemu/throttle.h | 4 ++-- util/throttle.c | 4 ++-- 2 files changed, 4 inse

Re: [Qemu-devel] [PATCH 1/4] throttle: Fix wrong variable name in the header documentation

2017-08-19 Thread Manos Pitsidianakis
On Thu, Aug 17, 2017 at 05:28:12PM +0300, Alberto Garcia wrote: The level of the burst bucket is stored in bkt.burst_level, not bkt.burst_lenght. s/lenght/length, otherwise: Reviewed-by: Manos Pitsidianakis <el13...@mail.ntua.gr> Signed-off-by: Alberto Garcia <be...@igalia.com>

Re: [Qemu-devel] [PATCH v5 4/6] block: convert ThrottleGroup to object with QOM

2017-08-19 Thread Manos Pitsidianakis
On Fri, Aug 18, 2017 at 03:05:31PM +0200, Alberto Garcia wrote: On Fri 18 Aug 2017 05:10:17 AM CEST, Manos Pitsidianakis wrote: * If no ThrottleGroup is found with the given name a new one is * created. * - * @name: the name of the ThrottleGroup + * This function edits throttle_groups

Re: [Qemu-devel] [PATCH v5 5/6] block: add throttle block filter driver

2017-08-18 Thread Manos Pitsidianakis
On Fri, Aug 18, 2017 at 10:23:09AM +0200, Alberto Garcia wrote: On Fri 18 Aug 2017 05:10:18 AM CEST, Manos Pitsidianakis wrote: block/throttle.c uses existing I/O throttle infrastructure inside a block filter driver. I/O operations are intercepted in the filter's read/write coroutines

[Qemu-devel] [PATCH v5 4/6] block: convert ThrottleGroup to object with QOM

2017-08-17 Thread Manos Pitsidianakis
{ "iops-total" : 99 } } } This also means a group's configuration can be fetched with qom-get. ThrottleGroups can be anonymous which means they can't get accessed by other users ie they will always be units instead of group (Because they have one ThrottleGroupMember

[Qemu-devel] [PATCH v5 1/6] block: move ThrottleGroup membership to ThrottleGroupMember

2017-08-17 Thread Manos Pitsidianakis
. This is done by gathering ThrottleGroup membership details from BlockBackendPublic into ThrottleGroupMember and refactoring existing code to use the structure. Reviewed-by: Alberto Garcia <be...@igalia.com> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Manos Pitsidi

[Qemu-devel] [PATCH v5 2/6] block: add aio_context field in ThrottleGroupMember

2017-08-17 Thread Manos Pitsidianakis
com> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- include/block/throttle-groups.h | 7 - block/block-backend.c | 15 -- block/throttle-groups.c | 38 - tes

[Qemu-devel] [PATCH v5 5/6] block: add throttle block filter driver

2017-08-17 Thread Manos Pitsidianakis
hrottling filter driver infrastructure + * + * Copyright (c) 2017 Manos Pitsidianakis + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either ve

[Qemu-devel] [PATCH v5 3/6] block: tidy ThrottleGroupMember initializations

2017-08-17 Thread Manos Pitsidianakis
Move the CoMutex and CoQueue inits inside throttle_group_register_tgm() which is called whenever a ThrottleGroupMember is initialized. There's no need for them to be separate. Reviewed-by: Alberto Garcia <be...@igalia.com> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-o

[Qemu-devel] [PATCH v5 0/6] add throttle block driver filter

2017-08-17 Thread Manos Pitsidianakis
in BlockDevOptionsThrottle v3: fix style error in 'add aio_context field in ThrottleGroupMember' v2: change QOM throttle group object name print valid ranges for uint on error move frees in throttle_group_obj_finalize() split throttle_group_{set,get}() add throttle_recurse_is_first_non_filter() Manos

[Qemu-devel] [PATCH v5 6/6] block: add iotest 184 for the throttle filter driver

2017-08-17 Thread Manos Pitsidianakis
Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- tests/qemu-iotests/184 | 310 + tests/qemu-iotests/184.out | 422 + tests/qemu-iotests/group | 1 + 3 files changed, 733 insertions(+) creat

Re: [Qemu-devel] [Qemu-block] [PATCH v2 1/2] block: use internal filter node in backup

2017-08-16 Thread Manos Pitsidianakis
On Wed, Aug 16, 2017 at 02:25:44PM +0100, Stefan Hajnoczi wrote: On Tue, Aug 15, 2017 at 11:18:53AM +0300, Manos Pitsidianakis wrote: block/backup.c currently uses before write notifiers on the targeted node. We can create a filter node instead to intercept write requests for the backup job

Re: [Qemu-devel] [PATCH RFC] block: add block-insert-node QMP command

2017-08-16 Thread Manos Pitsidianakis
On Wed, Aug 16, 2017 at 06:59:25AM -0500, Eric Blake wrote: On 08/16/2017 04:41 AM, Manos Pitsidianakis wrote: +## +# @block-insert-node: +# +# Insert a filter node between a specific edge in the block driver state graph. +# @parent: the name of the parent node or device +# @node:the name

Re: [Qemu-devel] [PATCH RFC] block: add block-insert-node QMP command

2017-08-16 Thread Manos Pitsidianakis
On Tue, Aug 15, 2017 at 05:12:42PM -0500, Eric Blake wrote: On 08/15/2017 02:45 AM, Manos Pitsidianakis wrote: block-insert-node and its pair command block-remove-node provide runtime insertion and removal of filter nodes. block-insert-node takes a (parent, child) and (node, child) pair

Re: [Qemu-devel] [PATCH v2 1/6] block: skip implicit nodes in snapshots, blockjobs

2017-08-15 Thread Manos Pitsidianakis
On Tue, Aug 15, 2017 at 03:24:38PM +0200, Alberto Garcia wrote: On Wed 09 Aug 2017 04:02:51 PM CEST, Manos Pitsidianakis wrote: @@ -2988,6 +3004,9 @@ void qmp_block_stream(bool has_job_id, const char *job_id, const char *device, return; } +/* Skip implicit filter nodes

[Qemu-devel] [PATCH v2 1/2] block: use internal filter node in backup

2017-08-15 Thread Manos Pitsidianakis
into the block layer. Block filter drivers are inserted into the graph only when a feature is needed. This makes the block layer more modular and reuses the block driver abstraction that is already present. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block.c

[Qemu-devel] [PATCH v2 2/2] block: add filter driver to block/write-threshold.c

2017-08-15 Thread Manos Pitsidianakis
present. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block/qapi.c| 2 +- block/write-threshold.c | 264 +++- include/block/write-threshold.h | 22 ++-- qapi/block-core.json| 19 ++- tests/test

[Qemu-devel] [PATCH v2 0/2] add internal backup job and write-threshold filter drivers

2017-08-15 Thread Manos Pitsidianakis
) to using the filter driver. v2: add motivation in commit messages dropped hunk that removed before-write notifiers Manos Pitsidianakis (2): block: use internal filter node in backup block: add filter driver to block/write-threshold.c block.c | 89

Re: [Qemu-devel] [PATCH 1/2] block: use internal filter node in backup

2017-08-15 Thread Manos Pitsidianakis
On Tue, Aug 15, 2017 at 10:44:15AM +0300, Vladimir Sementsov-Ogievskiy wrote: 15.08.2017 09:19, Manos Pitsidianakis wrote: block/backup.c currently uses before write notifiers on the targeted node. We can create a filter node instead to intercept write requests for the backup job on the BDS

[Qemu-devel] [PATCH RFC] block: add block-insert-node QMP command

2017-08-15 Thread Manos Pitsidianakis
BdrvChildRole. This is a different approach than x-blockdev-change which uses the driver methods bdrv_add_child() and bdrv_del_child(), Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block.c| 192 blockdev.c | 44 ++ include/block/b

[Qemu-devel] [PATCH 2/2] block: add filter driver to block/write-threshold.c

2017-08-15 Thread Manos Pitsidianakis
driver, so it is not affected. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block/qapi.c| 2 +- block/write-threshold.c | 264 +++- include/block/write-threshold.h | 22 ++-- qapi/block-core.json

[Qemu-devel] [PATCH 1/2] block: use internal filter node in backup

2017-08-15 Thread Manos Pitsidianakis
block/backup.c currently uses before write notifiers on the targeted node. We can create a filter node instead to intercept write requests for the backup job on the BDS level, instead of the BlockBackend level. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- b

[Qemu-devel] [PATCH 0/2] add internal backup job and write-threshold filter drivers

2017-08-15 Thread Manos Pitsidianakis
-threshold) to using the filter driver. Based-on: <20170809140256.25584-1-el13...@mail.ntua.gr> Manos Pitsidianakis (2): block: use internal filter node in backup block: add filter driver to block/write-threshold.c block.c | 89 -- block/ba

Re: [Qemu-devel] [PATCH v3 5/7] block: add throttle block filter driver

2017-08-14 Thread Manos Pitsidianakis
On Wed, Aug 09, 2017 at 05:39:42PM +0200, Kevin Wolf wrote: Am 09.08.2017 um 16:45 hat Alberto Garcia geschrieben: On Wed 09 Aug 2017 03:42:07 PM CEST, Manos Pitsidianakis wrote: > On Wed, Aug 09, 2017 at 02:36:20PM +0200, Alberto Garcia wrote: >>On Wed 09 Aug 2017 11:36:12 AM CE

Re: [Qemu-devel] [PATCH v4 5/7] block: add throttle block filter driver

2017-08-11 Thread Manos Pitsidianakis
On Wed, Aug 09, 2017 at 01:07:32PM +0300, Manos Pitsidianakis wrote: +static int coroutine_fn throttle_co_preadv(BlockDriverState *bs, + uint64_t offset, uint64_t bytes, + QEMUIOVector *qiov, int flags

Re: [Qemu-devel] [PATCH v4 5/7] block: add throttle block filter driver

2017-08-10 Thread Manos Pitsidianakis
On Thu, Aug 10, 2017 at 03:54:02PM +0200, Alberto Garcia wrote: On Wed 09 Aug 2017 12:07:32 PM CEST, Manos Pitsidianakis wrote: +/* Extract ThrottleConfig options. Assumes cfg is initialized and will be + * checked for validity. + * + * Returns -1 and sets errp if a burst_length value is over

[Qemu-devel] [PATCH v2 4/6] block: remove legacy I/O throttling

2017-08-09 Thread Manos Pitsidianakis
of the device. The legacy throttle node is managed by the legacy interface completely. More advanced configurations with the filter drive are possible using the QMP API, but these will be ignored by the legacy interface. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block

[Qemu-devel] [PATCH v2 0/6] block: remove legacy I/O throttling

2017-08-09 Thread Manos Pitsidianakis
-id when device is a node name new commit: remove BlockBackendPublic new commit: add dedicated iotest cleanup reference counting in block/block-backend.c functions add new function to get filter child bs take ownership of options in bdrv_new_open_driver() Manos Pitsidianakis (6): block

[Qemu-devel] [PATCH v2 3/6] block: require job-id when device is a node name

2017-08-09 Thread Manos Pitsidianakis
"sync": "full", "target": "backup.img" } } is not a BlockBackend name, instead of automatically getting it from the root BS if device is a node name. That information is lost after calling block_job_create(), so we can do it in its

[Qemu-devel] [PATCH v2 5/6] block: add iotest 191 for legacy throttling interface

2017-08-09 Thread Manos Pitsidianakis
Check that the implicit throttle filter driver node, used for compatibility with the legacy throttling interface on the BlockBackend level, works. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- tests/qemu-iotests/191 | 138 +

[Qemu-devel] [PATCH v2 1/6] block: skip implicit nodes in snapshots, blockjobs

2017-08-09 Thread Manos Pitsidianakis
BlockBackend, which we want to be skipped during automatic operations on the graph since the user does not necessarily know about their existence. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block.c | 10 ++ block/qapi.c

[Qemu-devel] [PATCH v2 2/6] block: add options parameter to bdrv_new_open_driver()

2017-08-09 Thread Manos Pitsidianakis
Allow passing a QDict *options parameter to bdrv_new_open_driver() so that it can be used if a driver needs it upon creation. The previous behaviour (empty bs->options and bs->explicit_options) remains when options is NULL. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr>

<    1   2   3   4   5   6   7   >