[Qemu-block] [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-block] [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-block] [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-block] [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-block] [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-block] [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-block] [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

[Qemu-block] [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-block] [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-block] [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-block] [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-block] [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

Re: [Qemu-block] [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-block] [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-block] [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-block] [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

[Qemu-block] [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-block] [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-block] [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

Re: [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-block] [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-block] [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-block] [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-block] [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-block] [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-block] [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-block] [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-block] [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-block] [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-block] [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-block] [PATCH v2 6/6] block: remove BlockBackendPublic

2017-08-09 Thread Manos Pitsidianakis
All BlockBackend level throttling (via the implicit throttle filter node) is done in block/block-backend.c and block/throttle-groups.c doesn't know about BlockBackends anymore. Since BlockBackendPublic is not needed anymore, remove it. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua

[Qemu-block] [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-block] [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-block] [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 +

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

2017-08-09 Thread Manos Pitsidianakis
On Wed, Aug 09, 2017 at 02:36:20PM +0200, Alberto Garcia wrote: On Wed 09 Aug 2017 11:36:12 AM CEST, Manos Pitsidianakis wrote: On Tue, Aug 08, 2017 at 05:04:48PM +0200, Alberto Garcia wrote: On Tue 08 Aug 2017 04:56:20 PM CEST, Manos Pitsidianakis wrote: So basically if we have anonymous

[Qemu-block] [PATCH v4 7/7] block: add throttle block filter driver interface tests

2017-08-09 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

[Qemu-block] [PATCH v4 3/7] block: tidy ThrottleGroupMember initializations

2017-08-09 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-block] [PATCH v4 5/7] block: add throttle block filter driver

2017-08-09 Thread Manos Pitsidianakis
-obj-y += throttle.o block-obj-y += crypto.o diff --git a/block/throttle.c b/block/throttle.c new file mode 100644 index 00..3e6cb1de7b --- /dev/null +++ b/block/throttle.c @@ -0,0 +1,315 @@ +/* + * QEMU block throttling filter driver infrastructure + * + * Copyright (c) 2017 Manos Pitsidi

[Qemu-block] [PATCH v4 6/7] block: add BlockDevOptionsThrottle to QAPI

2017-08-09 Thread Manos Pitsidianakis
This is needed to configure throttle filter driver nodes with QAPI. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- qapi/block-core.json | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json

[Qemu-block] [PATCH v4 2/7] block: add aio_context field in ThrottleGroupMember

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

[Qemu-block] [PATCH v4 1/7] block: move ThrottleGroup membership to ThrottleGroupMember

2017-08-09 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-block] [PATCH v4 0/7] add throttle block driver filter

2017-08-09 Thread Manos Pitsidianakis
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 (7): block: move ThrottleGroup membership to ThrottleGroupMember block: add aio_context

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

2017-08-08 Thread Manos Pitsidianakis
On Tue, Aug 08, 2017 at 04:53:08PM +0200, Alberto Garcia wrote: On Tue 08 Aug 2017 03:45:44 PM CEST, Manos Pitsidianakis wrote: On Tue, Aug 08, 2017 at 03:13:36PM +0200, Alberto Garcia wrote: On Mon 31 Jul 2017 11:54:41 AM CEST, Manos Pitsidianakis wrote: block/throttle.c uses existing I/O

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

2017-08-08 Thread Manos Pitsidianakis
On Tue, Aug 08, 2017 at 03:13:36PM +0200, Alberto Garcia wrote: On Mon 31 Jul 2017 11:54:41 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

Re: [Qemu-block] [PATCH v3 7/7] block: add throttle block filter driver interface tests

2017-08-03 Thread Manos Pitsidianakis
On Thu, Aug 03, 2017 at 03:32:58PM +0200, Kevin Wolf wrote: Am 03.08.2017 um 15:24 hat Manos Pitsidianakis geschrieben: On Thu, Aug 03, 2017 at 10:07:50AM +0200, Kevin Wolf wrote: > Am 31.07.2017 um 11:54 hat Manos Pitsidianakis geschrieben: > > Signed-off-by: Manos Pitsidiana

Re: [Qemu-block] [PATCH v3 7/7] block: add throttle block filter driver interface tests

2017-08-03 Thread Manos Pitsidianakis
On Thu, Aug 03, 2017 at 10:07:50AM +0200, Kevin Wolf wrote: Am 31.07.2017 um 11:54 hat Manos Pitsidianakis geschrieben: Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> I would add at least two more cases: * Both limits and throttle-group are given in blockdev-add This

Re: [Qemu-block] [PATCH v3 4/7] block: convert ThrottleGroup to object with QOM

2017-08-03 Thread Manos Pitsidianakis
On Thu, Aug 03, 2017 at 01:17:01PM +0200, Kevin Wolf wrote: Am 03.08.2017 um 12:53 hat Stefan Hajnoczi geschrieben: On Thu, Aug 03, 2017 at 10:08:01AM +0200, Kevin Wolf wrote: > Am 02.08.2017 um 12:57 hat Manos Pitsidianakis geschrieben: > > On Wed, Aug 02, 2017 at 11:39:22AM +010

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

2017-08-03 Thread Manos Pitsidianakis
On Thu, Aug 03, 2017 at 10:07:41AM +0200, Kevin Wolf wrote: Am 31.07.2017 um 11:54 hat Manos Pitsidianakis geschrieben: +/* Extract ThrottleConfig options. Assumes cfg is initialized and will be + * checked for validity. + */ +static int throttle_extract_options(QemuOpts *opts, ThrottleConfig

Re: [Qemu-block] [PATCH 3/3] block: remove legacy I/O throttling

2017-08-02 Thread Manos Pitsidianakis
On Wed, Aug 02, 2017 at 12:33:19PM +0200, Kevin Wolf wrote: Am 02.08.2017 um 12:07 hat Stefan Hajnoczi geschrieben: On Tue, Aug 01, 2017 at 04:49:07PM +0300, Manos Pitsidianakis wrote: > diff --git a/block.c b/block.c > index 9ebdba28b0..c6aad25286 100644 > --- a/block.c > +

Re: [Qemu-block] [PATCH v3 4/7] block: convert ThrottleGroup to object with QOM

2017-08-02 Thread Manos Pitsidianakis
On Wed, Aug 02, 2017 at 11:39:22AM +0100, Stefan Hajnoczi wrote: On Tue, Aug 01, 2017 at 07:49:33PM +0300, Manos Pitsidianakis wrote: On Tue, Aug 01, 2017 at 04:47:03PM +0100, Stefan Hajnoczi wrote: > On Mon, Jul 31, 2017 at 12:54:40PM +0300, Manos Pitsidianakis wrote: > > Thro

Re: [Qemu-block] [PATCH 3/3] block: remove legacy I/O throttling

2017-08-02 Thread Manos Pitsidianakis
On Wed, Aug 02, 2017 at 11:07:24AM +0100, Stefan Hajnoczi wrote: On Tue, Aug 01, 2017 at 04:49:07PM +0300, Manos Pitsidianakis wrote: diff --git a/block.c b/block.c index 9ebdba28b0..c6aad25286 100644 --- a/block.c +++ b/block.c @@ -1975,6 +1975,7 @@ BdrvChild *bdrv_root_attach_child

Re: [Qemu-block] [PATCH v3 4/7] block: convert ThrottleGroup to object with QOM

2017-08-01 Thread Manos Pitsidianakis
On Tue, Aug 01, 2017 at 04:47:03PM +0100, Stefan Hajnoczi wrote: On Mon, Jul 31, 2017 at 12:54:40PM +0300, Manos Pitsidianakis wrote: ThrottleGroup is converted to an object. This will allow the future throttle block filter drive easy creation and configuration of throttle groups in QMP and cli

Re: [Qemu-block] [RFC] block-insert-node and block-job-delete

2017-08-01 Thread Manos Pitsidianakis
On Tue, Aug 01, 2017 at 03:50:36PM +0200, Kevin Wolf wrote: Am 31.07.2017 um 19:30 hat Manos Pitsidianakis geschrieben: On Fri, Jul 28, 2017 at 02:08:43PM +0200, Kevin Wolf wrote: > Am 27.07.2017 um 12:07 hat Stefan Hajnoczi geschrieben: > > On Wed, Jul 26, 2017 at 09:23:20PM +03

[Qemu-block] [PATCH 1/3] block: add options parameter to bdrv_new_open_driver()

2017-08-01 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>

[Qemu-block] [PATCH 2/3] block: skip implicit nodes in snapshots, blockjobs

2017-08-01 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 | 17 + blockdev.c

[Qemu-block] [PATCH 0/3] block: remove legacy I/O throttling

2017-08-01 Thread Manos Pitsidianakis
the device's BlockBackend. Manos Pitsidianakis (3): block: add options parameter to bdrv_new_open_driver() block: skip implicit nodes in snapshots, blockjobs block: remove legacy I/O throttling block.c | 41 ++- block/block-backend.c | 149

[Qemu-block] [PATCH 3/3] block: remove legacy I/O throttling

2017-08-01 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> --- b

Re: [Qemu-block] [RFC] block-insert-node and block-job-delete

2017-07-31 Thread Manos Pitsidianakis
On Fri, Jul 28, 2017 at 02:08:43PM +0200, Kevin Wolf wrote: Am 27.07.2017 um 12:07 hat Stefan Hajnoczi geschrieben: On Wed, Jul 26, 2017 at 09:23:20PM +0300, Manos Pitsidianakis wrote: > On Wed, Jul 26, 2017 at 04:12:21PM +0100, Stefan Hajnoczi wrote: > > On Wed, Jul 26, 2017 at 0

[Qemu-block] [PATCH v3 7/7] block: add throttle block filter driver interface tests

2017-07-31 Thread Manos Pitsidianakis
Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- tests/qemu-iotests/184 | 237 + tests/qemu-iotests/184.out | 319 + tests/qemu-iotests/group | 1 + 3 files changed, 557 insertions(+) creat

[Qemu-block] [PATCH v3 6/7] block: add BlockDevOptionsThrottle to QAPI

2017-07-31 Thread Manos Pitsidianakis
This is needed to configure throttle filter driver nodes with QAPI. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- qapi/block-core.json | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json

[Qemu-block] [PATCH v3 1/7] block: move ThrottleGroup membership to ThrottleGroupMember

2017-07-31 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: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block/blo

[Qemu-block] [PATCH v3 4/7] block: convert ThrottleGroup to object with QOM

2017-07-31 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 ThrottleGroupM

[Qemu-block] [PATCH v3 2/7] block: add aio_context field in ThrottleGroupMember

2017-07-31 Thread Manos Pitsidianakis
com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block/block-backend.c | 15 +- block/throttle-groups.c | 38 - include/block/throttle-groups.h | 7 - tests/test-throttle.c

[Qemu-block] [PATCH v3 0/7] add throttle block driver filter

2017-07-31 Thread Manos Pitsidianakis
' 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 (7): block: move ThrottleGroup membership to ThrottleGroupMember

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

2017-07-31 Thread Manos Pitsidianakis
-obj-y += throttle.o block-obj-y += crypto.o diff --git a/block/throttle.c b/block/throttle.c new file mode 100644 index 00..f3395462fb --- /dev/null +++ b/block/throttle.c @@ -0,0 +1,395 @@ +/* + * QEMU block throttling filter driver infrastructure + * + * Copyright (c) 2017 Manos Pitsidi

[Qemu-block] [PATCH v3 3/7] block: tidy ThrottleGroupMember initializations

2017-07-31 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: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr>

Re: [Qemu-block] [Qemu-devel] [RFC] block-insert-node and block-job-delete

2017-07-28 Thread Manos Pitsidianakis
On Thu, Jul 27, 2017 at 06:09:04PM -0400, John Snow wrote: On 07/26/2017 02:23 PM, Manos Pitsidianakis wrote: On Wed, Jul 26, 2017 at 04:12:21PM +0100, Stefan Hajnoczi wrote: On Wed, Jul 26, 2017 at 05:19:24PM +0300, Manos Pitsidianakis wrote: This proposal follows a discussion we had

Re: [Qemu-block] [RFC] block-insert-node and block-job-delete

2017-07-26 Thread Manos Pitsidianakis
On Wed, Jul 26, 2017 at 04:12:21PM +0100, Stefan Hajnoczi wrote: On Wed, Jul 26, 2017 at 05:19:24PM +0300, Manos Pitsidianakis wrote: This proposal follows a discussion we had with Kevin and Stefan on filter node management. With block filter drivers arises a need to configure filter nodes

[Qemu-block] [PATCH v2 7/7] block: add throttle block filter driver interface tests

2017-07-26 Thread Manos Pitsidianakis
Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- tests/qemu-iotests/184 | 237 + tests/qemu-iotests/184.out | 319 + tests/qemu-iotests/group | 1 + 3 files changed, 557 insertions(+) creat

[Qemu-block] [PATCH v2 6/7] block: add BlockDevOptionsThrottle to QAPI

2017-07-26 Thread Manos Pitsidianakis
This is needed to configure throttle filter driver nodes with QAPI. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- qapi/block-core.json | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json

[Qemu-block] [PATCH v2 1/7] block: move ThrottleGroup membership to ThrottleGroupMember

2017-07-26 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: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block/blo

[Qemu-block] [PATCH v2 5/7] block: add throttle block filter driver

2017-07-26 Thread Manos Pitsidianakis
-obj-y += throttle.o block-obj-y += crypto.o diff --git a/block/throttle.c b/block/throttle.c new file mode 100644 index 00..f3395462fb --- /dev/null +++ b/block/throttle.c @@ -0,0 +1,395 @@ +/* + * QEMU block throttling filter driver infrastructure + * + * Copyright (c) 2017 Manos Pitsidi

[Qemu-block] [PATCH v2 4/7] block: convert ThrottleGroup to object with QOM

2017-07-26 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 ThrottleGroupM

[Qemu-block] [PATCH v2 0/7] add throttle block driver filter

2017-07-26 Thread Manos Pitsidianakis
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 (7): block: move ThrottleGroup membership to ThrottleGroupMember block: add aio_context field in ThrottleGroupMember block: tidy

[Qemu-block] [PATCH v2 3/7] block: tidy ThrottleGroupMember initializations

2017-07-26 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: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr>

[Qemu-block] [PATCH v2 2/7] block: add aio_context field in ThrottleGroupMember

2017-07-26 Thread Manos Pitsidianakis
com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block/block-backend.c | 14 - block/throttle-groups.c | 38 - include/block/throttle-groups.h | 7 - tests/test-throttle.c | 63 +---

[Qemu-block] [RFC] block-insert-node and block-job-delete

2017-07-26 Thread Manos Pitsidianakis
This proposal follows a discussion we had with Kevin and Stefan on filter node management. With block filter drivers arises a need to configure filter nodes on runtime with QMP on live graphs. A problem with doing live graph modifications is that some block jobs modify the graph when they are

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

2017-07-25 Thread Manos Pitsidianakis
On Tue, Jul 25, 2017 at 05:09:41PM +0100, Stefan Hajnoczi wrote: On Tue, Jul 25, 2017 at 01:29:08PM +0300, Manos Pitsidianakis wrote: On Mon, Jul 24, 2017 at 04:12:47PM +0100, Stefan Hajnoczi wrote: > On Fri, Jul 14, 2017 at 12:45:18PM +0300, Manos Pitsidianakis wrote: > > Thro

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

2017-07-25 Thread Manos Pitsidianakis
On Mon, Jul 24, 2017 at 04:12:47PM +0100, Stefan Hajnoczi wrote: On Fri, Jul 14, 2017 at 12:45:18PM +0300, Manos Pitsidianakis wrote: ThrottleGroup is converted to an object. This will allow the future throttle block filter drive easy creation and configuration of throttle groups in QMP and cli

Re: [Qemu-block] [PATCH] qemu-iotests: add a "how to" to ./README

2017-07-22 Thread Manos Pitsidianakis
ting README that ./check runs just the raw format but it might be a good idea to mention that it's the default in the Howto as well. For this patch though: Reviewed-by: Manos Pitsidianakis <el13...@mail.ntua.gr> While we're on the topic of qemu-iotests, it'd be a nice thing to parallelize the tests with a Makefile. signature.asc Description: PGP signature

Re: [Qemu-block] [PATCH for-2.10] block: Skip implicit nodes in query-block/blockstats

2017-07-19 Thread Manos Pitsidianakis
patch is not in the list archives either). Reviewed-by: Manos Pitsidianakis <el13...@mail.ntua.gr> signature.asc Description: PGP signature

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

2017-07-18 Thread Manos Pitsidianakis
On Fri, Jul 14, 2017 at 12:45:19PM +0300, Manos Pitsidianakis wrote: +static BlockDriver bdrv_throttle = { +.format_name= "throttle", +.protocol_name = "throttle", +.instance_size = sizeof

Re: [Qemu-block] [Qemu-devel] [PATCH v3 1/2] block: fix dangling bs->explicit_options in block.c

2017-07-14 Thread Manos Pitsidianakis
On Fri, Jul 14, 2017 at 09:42:22AM -0500, Eric Blake wrote: On 07/14/2017 09:35 AM, Manos Pitsidianakis wrote: In some error paths it is possible to QDECREF a freed dangling explicit_options, resulting in a heap overflow crash. For example bdrv_open_inherit()'s fail unrefs it, then calls

[Qemu-block] [PATCH v3 2/2] block: fix leaks in bdrv_open_driver()

2017-07-14 Thread Manos Pitsidianakis
If open succeeds but we fail after, return the error and let callers unref and delete their bs, while cleaning up their allocations. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff -

[Qemu-block] [PATCH v3 1/2] block: fix dangling bs->explicit_options in block.c

2017-07-14 Thread Manos Pitsidianakis
In some error paths it is possible to QDECREF a freed dangling explicit_options, resulting in a heap overflow crash. For example bdrv_open_inherit()'s fail unrefs it, then calls bdrv_unref which calls bdrv_close which also unrefs it. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua

[Qemu-block] [PATCH v3 0/2] fix leaks in bdrv_open_driver()

2017-07-14 Thread Manos Pitsidianakis
v3: new commit: block: fix dangling bs->explicit_options in block.c rework error paths in bdrv_open_driver() v2: move bdrv_unref_child(bs, bs->file) to bdrv_open_driver do not set bs->drv to NULL if open succeeds Manos Pitsidianakis (2): block: fix dangling bs->explicit_option

[Qemu-block] [PATCH 4/7] block: convert ThrottleGroup to object with QOM

2017-07-14 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 ThrottleGroupMe

[Qemu-block] [PATCH 3/7] block: tidy ThrottleGroupMember initializations

2017-07-14 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. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block/block-backend.c | 3 --- block/throttle-gr

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

2017-07-14 Thread Manos Pitsidianakis
-obj-y += throttle.o block-obj-y += crypto.o diff --git a/block/throttle.c b/block/throttle.c new file mode 100644 index 00..5665ccd8b5 --- /dev/null +++ b/block/throttle.c @@ -0,0 +1,345 @@ +/* + * QEMU block throttling filter driver infrastructure + * + * Copyright (c) 2017 Manos Pitsidi

[Qemu-block] [PATCH 2/7] block: add aio_context field in ThrottleGroupMember

2017-07-14 Thread Manos Pitsidianakis
timer_cb() needs to know about the current Aio context of the throttle request that is woken up. In order to make ThrottleGroupMember backend agnostic, this information is stored in an aio_context field instead of accessing it from BlockBackend. Signed-off-by: Manos Pitsidianakis <e

[Qemu-block] [PATCH 1/7] block: move ThrottleGroup membership to ThrottleGroupMember

2017-07-14 Thread Manos Pitsidianakis
. This is done by gathering ThrottleGroup membership details from BlockBackendPublic into ThrottleGroupMember and refactoring existing code to use the structure. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- Notes: Dropped R-b because I changed some of the comments (remov

[Qemu-block] [PATCH 0/7] add throttle block driver filter

2017-07-14 Thread Manos Pitsidianakis
configurations (throttling at any point in the graph, chained filters) There's also the question of how filter drivers affect the rest of the block layer, especially live block jobs. This won't be tackled in this series though. Manos Pitsidianakis (7): block: move ThrottleGroup membership

[Qemu-block] [PATCH 7/7] block: add throttle block filter driver interface tests

2017-07-14 Thread Manos Pitsidianakis
Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- tests/qemu-iotests/184 | 237 + tests/qemu-iotests/184.out | 319 + tests/qemu-iotests/group | 1 + 3 files changed, 557 insertions(+) creat

[Qemu-block] [PATCH 6/7] block: add BlockDevOptionsThrottle to QAPI

2017-07-14 Thread Manos Pitsidianakis
This is needed to configure throttle filter driver nodes with QAPI. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- qapi/block-core.json | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json

[Qemu-block] [PATCH v6 3/4] block: remove bdrv_truncate callback in blkdebug

2017-07-13 Thread Manos Pitsidianakis
d-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block/blkdebug.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index c19ab28f07..91ffd1fe12 100644 --- a/bloc

[Qemu-block] [PATCH v6 2/4] block: remove unused bdrv_media_changed

2017-07-13 Thread Manos Pitsidianakis
i <stefa...@redhat.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block.c | 14 -- block/raw-format.c| 6 -- include/block/block.h | 1 - include/block/block_int.h | 1 - 4 files changed, 22 deletions(-) diff --git a/

[Qemu-block] [PATCH v6 4/4] block: add default implementations for bdrv_co_get_block_status()

2017-07-13 Thread Manos Pitsidianakis
edhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Reviewed-by: Kevin Wolf <kw...@redhat.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block/blkdebug.c | 12 +--- block/commit.c

[Qemu-block] [PATCH v6 0/4] block: Block driver callbacks fixes

2017-07-13 Thread Manos Pitsidianakis
octl() new patch: remove duplicate code from block/raw-format.c Manos Pitsidianakis (4): block: pass bdrv_* methods to bs->file by default in block filters block: remove unused bdrv_media_changed block: remove bdrv_truncate callback in blkdebug block: add default implementations for bdr

[Qemu-block] [PATCH v6 1/4] block: pass bdrv_* methods to bs->file by default in block filters

2017-07-13 Thread Manos Pitsidianakis
edhat.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block.c | 21 +++-- include/block/block_int.h | 6 +- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/block.c b/block.c index d24ae85868..dd409bfb5b 100644 --- a/b

Re: [Qemu-block] [PATCH v5 1/4] block: pass bdrv_* methods to bs->file by default in block filters

2017-07-13 Thread Manos Pitsidianakis
On Thu, Jul 13, 2017 at 06:23:14AM -0500, Eric Blake wrote: On 07/13/2017 05:01 AM, Manos Pitsidianakis wrote: The following functions fail if bs->drv is a filter and does not implement them: bdrv_probe_blocksizes bdrv_probe_geometry bdrv_truncate bdrv_has_zero_init bdrv_get_info Inst

<    1   2   3   >