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

Re: [Qemu-devel] [PATCH v7 0/6] fsdev: qmp interface for io throttling

2017-07-14 Thread Manos Pitsidianakis
On Fri, Jul 14, 2017 at 03:15:06PM +0200, Pradeep Jagadeesh wrote: Hi Manos, Thanks for sharing the link to your code patch. On 7/14/2017 2:22 PM, Manos Pitsidianakis wrote: Hello Pradeep, you might be interested in my work on refactoring the block layer's throttling interface in my series

Re: [Qemu-devel] [PATCH v7 0/6] fsdev: qmp interface for io throttling

2017-07-14 Thread Manos Pitsidianakis
Hello Pradeep, you might be interested in my work on refactoring the block layer's throttling interface in my series: https://lists.nongnu.org/archive/html/qemu-devel/2017-07/msg04191.html In this series you copy the existing legacy interface we want to get rid of. I think it will be easier

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

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

2017-07-13 Thread Manos Pitsidianakis
Now that bdrv_truncate is passed to bs->file by default, remove the callback from block/blkdebug.c and set is_filter to true. Reviewed-by: Eric Blake <ebl...@redhat.com> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.n

[Qemu-devel] [PATCH v5 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-devel] [PATCH v5 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..892f29d231 100644 --- a/b

[Qemu-devel] [PATCH v5 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> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.c

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

2017-07-13 Thread Manos Pitsidianakis
remove bdrv_truncate method from blkdebug v2: do not pass to bs->file if bs->drv is NULL move bs->file check outside of bdrv_inc_in_flight() area in bdrv_co_ioctl() new patch: remove duplicate code from block/raw-format.c Manos Pitsidianakis (4): block: pass bdrv_* methods to bs-&

Re: [Qemu-devel] [PATCH v14 15/21] qom: support non-scalar properties with -object

2017-07-12 Thread Manos Pitsidianakis
On Tue, Jul 11, 2017 at 03:49:50PM +0100, Daniel P. Berrange wrote: On Tue, Jul 11, 2017 at 04:44:46PM +0200, Markus Armbruster wrote: Markus Armbruster <arm...@redhat.com> writes: > Manos Pitsidianakis <el13...@mail.ntua.gr> writes: > >> Is there a specific reason th

Re: [Qemu-devel] [PATCH v4 2/4] block: remove bdrv_media_changed

2017-07-12 Thread Manos Pitsidianakis
On Wed, Jul 12, 2017 at 05:15:01PM +0200, Kevin Wolf wrote: Am 12.07.2017 um 09:41 hat Markus Armbruster geschrieben: Eric Blake <ebl...@redhat.com> writes: > On 07/11/2017 11:37 AM, Manos Pitsidianakis wrote: >> This function is not used anywhere, so remove it. >> >

Re: [Qemu-devel] [PATCH v2] block: fix leaks in bdrv_open_driver()

2017-07-12 Thread Manos Pitsidianakis
On Wed, Jul 12, 2017 at 10:33:37AM +0200, Kevin Wolf wrote: Am 11.07.2017 um 20:50 hat Manos Pitsidianakis geschrieben: On Tue, Jul 11, 2017 at 05:16:17PM +0200, Kevin Wolf wrote: >Am 01.07.2017 um 17:39 hat Manos Pitsidianakis geschrieben: >>bdrv_open_driver() is called in t

Re: [Qemu-devel] [PATCH v4 0/4] block: Block driver callbacks fixes

2017-07-12 Thread Manos Pitsidianakis
On Wed, Jul 12, 2017 at 09:49:20AM +0200, Markus Armbruster wrote: Manos Pitsidianakis <el13...@mail.ntua.gr> writes: This series makes implementing some of the bdrv_* callbacks easier for block filters by passing requests to bs->file if bs->drv doesn't implement it instea

Re: [Qemu-devel] [PATCH v2] block: fix leaks in bdrv_open_driver()

2017-07-11 Thread Manos Pitsidianakis
On Tue, Jul 11, 2017 at 05:16:17PM +0200, Kevin Wolf wrote: Am 01.07.2017 um 17:39 hat Manos Pitsidianakis geschrieben: bdrv_open_driver() is called in two places, bdrv_new_open_driver() and bdrv_open_common(). In the latter, failure cleanup in is in its caller, bdrv_open_inherit(), which

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

2017-07-11 Thread Manos Pitsidianakis
ithout implementing them. This commit makes `drv->is_filter = true` imply that these callbacks will be forwarded to bs->file by default, so disabling support for these functions must be done explicitly. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block.c

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

2017-07-11 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-devel] [PATCH v4 3/4] block: remove bdrv_truncate callback in blkdebug

2017-07-11 Thread Manos Pitsidianakis
Now that bdrv_truncate is passed to bs->file by default, remove the callback from block/blkdebug.c and set is_filter to true. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block/blkdebug.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/block/b

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

2017-07-11 Thread Manos Pitsidianakis
estion new patch: remove bdrv_truncate method from blkdebug v2: do not pass to bs->file if bs->drv is NULL move bs->file check outside of bdrv_inc_in_flight() area in bdrv_co_ioctl() new patch: remove duplicate code from block/raw-format.c Manos Pitsidianakis (4): block: pass bdrv_

[Qemu-devel] [PATCH v4 2/4] block: remove bdrv_media_changed

2017-07-11 Thread Manos Pitsidianakis
This function is not used anywhere, so remove it. 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 del

Re: [Qemu-devel] [PATCH v14 15/21] qom: support non-scalar properties with -object

2017-07-10 Thread Manos Pitsidianakis
Is there a specific reason this patch wasn't finished? If I'm not wrong using non-scalar properties with -object is still not possible, yet would be a very useful feature for drivers with UserCreatable objects. Archive link since this is an old patch:

Re: [Qemu-devel] [PATCH] block: fix bs->file leak in bdrv_new_open_driver()

2017-07-07 Thread Manos Pitsidianakis
On Fri, Jul 07, 2017 at 11:28:15AM +0200, Kevin Wolf wrote: Am 29.06.2017 um 22:06 hat Manos Pitsidianakis geschrieben: On Thu, Jun 29, 2017 at 03:57:49PM +0200, Kevin Wolf wrote: >Am 29.06.2017 um 14:07 hat Manos Pitsidianakis geschrieben: >>On Thu, Jun 29, 2017 at 01:18:24PM +0200, K

[Qemu-devel] [PATCH v3 3/4] block: Remove bdrv_truncate callback in blkdebug

2017-07-04 Thread Manos Pitsidianakis
Now that bdrv_truncate is passed to bs->file by default, remove the callback from block/blkdebug.c Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block/blkdebug.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index b25856c4.

[Qemu-devel] [PATCH v3 2/4] block: Use defaults of bdrv_* callbacks in raw

2017-07-04 Thread Manos Pitsidianakis
Now that passing the call to bs->file is the default for some bdrv_* callbacks, remove the duplicate implementations in block/raw-format.c Reviewed-by: Eric Blake <ebl...@redhat.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block/ra

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

2017-07-04 Thread Manos Pitsidianakis
duplicate code from block/raw-format.c Manos Pitsidianakis (4): block: Pass bdrv_* methods to bs->file by default block: Use defaults of bdrv_* callbacks in raw block: Remove bdrv_truncate callback in blkdebug block: Add default implementations for bdrv_co_get_block_status() block.c

[Qemu-devel] [PATCH v3 4/4] block: Add default implementations for bdrv_co_get_block_status()

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

[Qemu-devel] [PATCH v3 1/4] block: Pass bdrv_* methods to bs->file by default

2017-07-04 Thread Manos Pitsidianakis
filter drivers to support those methods without implementing them. Reviewed-by: Eric Blake <ebl...@redhat.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block.c| 27 +-- block/io.c | 5 + 2 files changed, 30 insertions(+), 2 deleti

Re: [Qemu-devel] [PATCH v2 3/3] block: add default implementations for bdrv_co_get_block_status()

2017-07-03 Thread Manos Pitsidianakis
On Mon, Jul 03, 2017 at 12:51:45PM -0500, Eric Blake wrote: On 07/03/2017 11:12 AM, Eric Blake wrote: On 06/29/2017 01:43 PM, Manos Pitsidianakis wrote: bdrv_co_get_block_status_from_file() and bdrv_co_get_block_status_from_backing() set *file to bs->file and bs->backing respective

[Qemu-devel] [PATCH 0/2] ThrottleGroup configuration fixes

2017-07-02 Thread Manos Pitsidianakis
Since in the future ThrottleGroup configuration will be done even if it has no members, we need to separate the two. Manos Pitsidianakis (2): block: add clock_type field to ThrottleGroup block: remove timer canceling in throttle_config() block/throttle-groups.c | 27

[Qemu-devel] [PATCH 1/2] block: add clock_type field to ThrottleGroup

2017-07-02 Thread Manos Pitsidianakis
-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block/throttle-groups.c | 20 ++-- fsdev/qemu-fsdev-throttle.c | 2 +- include/qemu/throttle.h | 1 + tests/test-throttle.c | 4 ++-- util/throttle.c | 4 +++- 5 files changed, 17 insertions(

[Qemu-devel] [PATCH 2/2] block: remove timer canceling in throttle_config()

2017-07-02 Thread Manos Pitsidianakis
requests will follow the new configuration. This also allows a throttle group's configuration to be changed even when it has no members. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block/throttle-groups.c | 10 +- fsdev/qemu-fsdev-throttle.c | 2 +- includ

[Qemu-devel] [PATCH v2] block: fix leaks in bdrv_open_driver()

2017-07-01 Thread Manos Pitsidianakis
e care of all callers and do not set bs->drv to NULL unless the driver's open function failed. When bs is destroyed by removing its last reference, bdrv_close() checks bs->drv to perform the needed cleanups and also call the driver's close function. Signed-off-by: Manos Pitsidianakis <el13.

Re: [Qemu-devel] [PATCH] block: fix bs->file leak in bdrv_new_open_driver()

2017-06-29 Thread Manos Pitsidianakis
On Thu, Jun 29, 2017 at 03:57:49PM +0200, Kevin Wolf wrote: Am 29.06.2017 um 14:07 hat Manos Pitsidianakis geschrieben: On Thu, Jun 29, 2017 at 01:18:24PM +0200, Kevin Wolf wrote: >Am 29.06.2017 um 08:03 hat Manos Pitsidianakis geschrieben: >>bdrv_open_driver() is called in t

[Qemu-devel] [PATCH v2 3/3] block: add default implementations for bdrv_co_get_block_status()

2017-06-29 Thread Manos Pitsidianakis
<stefa...@redhat.com> Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block/blkdebug.c | 12 +--- block/commit.c| 12 +--- block/io.c| 24 block/mirror.c| 12 +--- include/bloc

[Qemu-devel] [PATCH v2 1/3] block: pass bdrv_* methods to bs->file by default

2017-06-29 Thread Manos Pitsidianakis
filter drivers to support those methods without implementing them. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block.c| 27 +-- block/io.c | 5 + 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/block.c b/block.c index 694396

[Qemu-devel] [PATCH v2 2/3] block: use defaults of bdrv_* callbacks in raw

2017-06-29 Thread Manos Pitsidianakis
Now that passing the call to bs->file is the default for some bdrv_* callbacks, remove the duplicate implementations in block/raw-format.c Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block/raw-format.c | 32 +--- 1 file changed, 1 inserti

[Qemu-devel] [PATCH v2 0/3] block: block driver callbacks fixes

2017-06-29 Thread Manos Pitsidianakis
commit 0dd2ec6bc46bd93ea0b9df602962883417f31400 v2: do not pass to bs->file if bs->drv is NULL move bs->file check outside of bdrv_inc_in_flight() area in bdrv_co_ioctl() new patch: remove duplicate code from block/raw-format.c Manos Pitsidianakis (3): block: pass bdrv_* methods to bs-&

Re: [Qemu-devel] [PATCH] block: fix bs->file leak in bdrv_new_open_driver()

2017-06-29 Thread Manos Pitsidianakis
On Thu, Jun 29, 2017 at 01:18:24PM +0200, Kevin Wolf wrote: Am 29.06.2017 um 08:03 hat Manos Pitsidianakis geschrieben: bdrv_open_driver() is called in two places, bdrv_new_open_driver() and bdrv_open_common(). In the latter, failure cleanup in is in its caller, bdrv_open_inherit(), which

[Qemu-devel] [PATCH] block: fix bs->file leak in bdrv_new_open_driver()

2017-06-29 Thread Manos Pitsidianakis
off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block.c b/block.c index 694396281b..aeacd520e0 100644 --- a/block.c +++ b/block.c @@ -1165,6 +1165,9 @@ BlockDriverState *bdrv_new_open_driver(BlockDriver *drv, const char *

Re: [Qemu-devel] [PATCH RFC v3 3/8] block: add throttle block filter driver

2017-06-28 Thread Manos Pitsidianakis
On Wed, Jun 28, 2017 at 05:36:54PM +0200, Kevin Wolf wrote: Am 28.06.2017 um 17:22 hat Manos Pitsidianakis geschrieben: Since we're moving groups to QOM we will need ids for each group. Can objects be anonymous? Hm, that's a good question. But object_new() doesn't take an ID, so I think

Re: [Qemu-devel] [PATCH RFC v3 3/8] block: add throttle block filter driver

2017-06-28 Thread Manos Pitsidianakis
On Wed, Jun 28, 2017 at 04:40:12PM +0200, Kevin Wolf wrote: Am 23.06.2017 um 14:46 hat Manos Pitsidianakis geschrieben: 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, and referred

Re: [Qemu-devel] [PATCH RFC v3 6/8] block: add options parameter to bdrv_new_open_driver()

2017-06-28 Thread Manos Pitsidianakis
On Wed, Jun 28, 2017 at 03:42:41PM +0200, Alberto Garcia wrote: On Fri 23 Jun 2017 02:46:58 PM CEST, Manos Pitsidianakis wrote: BlockDriverState *bdrv_new_open_driver(BlockDriver *drv, const char *node_name, - int flags, Error **errp

Re: [Qemu-devel] [PATCH RFC v3 5/8] block: add BlockDevOptionsThrottle to QAPI

2017-06-28 Thread Manos Pitsidianakis
On Wed, Jun 28, 2017 at 03:35:48PM +0200, Alberto Garcia wrote: On Fri 23 Jun 2017 02:46:57 PM CEST, Manos Pitsidianakis wrote: +# @BlockdevOptionsThrottle: +# +# Driver specific block device options for Throttle +# I would put this earlier in the json file, together with the rest

Re: [Qemu-devel] [PATCH RFC v3 2/8] block: Add aio_context field in ThrottleGroupMember

2017-06-28 Thread Manos Pitsidianakis
On Wed, Jun 28, 2017 at 01:27:36PM +0200, Kevin Wolf wrote: Am 23.06.2017 um 14:46 hat Manos Pitsidianakis geschrieben: 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

Re: [Qemu-devel] [Qemu-block] [PATCH v3 19/20] block: Minimize raw use of bds->total_sectors

2017-06-28 Thread Manos Pitsidianakis
tors_inter < intermediate->total_sectors)) { +(intermediate == top || sector_num + psectors_inter < size_inter)) { n = psectors_inter; } -- 2.9.4 Reviewed-by: Manos Pitsidianakis <el13...@mail.ntua.gr> signature.asc Description: PGP signature

[Qemu-devel] [PATCH 2/2] block: add default implementations for bdrv_co_get_block_status()

2017-06-27 Thread Manos Pitsidianakis
bdrv_co_get_block_status_from_file() and bdrv_co_get_block_status_from_backing() set *file to bs->file and bs->backing respectively, so that bdrv_co_get_block_status() can recurse to them. Future block drivers won't have to duplicate code to implement this. Signed-off-by: Manos Pitsidi

[Qemu-devel] [PATCH 1/2] block: pass bdrv_* methods to bs->file by default

2017-06-27 Thread Manos Pitsidianakis
filter drivers to support those methods without implementing them. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block.c| 45 ++--- block/io.c | 4 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/block.c b/b

[Qemu-devel] [PATCH 0/2] block: block driver callbacks fixes

2017-06-27 Thread Manos Pitsidianakis
commit 0dd2ec6bc46bd93ea0b9df602962883417f31400 Manos Pitsidianakis (2): block: pass bdrv_* methods to bs->file by default block: add default implementations for bdrv_co_get_block_status() block.c | 45 ++--- block/blkdebug.c

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

2017-06-27 Thread Manos Pitsidianakis
On Tue, Jun 27, 2017 at 06:05:55PM +0200, Alberto Garcia wrote: On Mon 26 Jun 2017 06:58:32 PM CEST, Manos Pitsidianakis wrote: On Mon, Jun 26, 2017 at 03:52:34PM +0100, Stefan Hajnoczi wrote: On Fri, Jun 23, 2017 at 03:46:56PM +0300, Manos Pitsidianakis wrote: +static bool

Re: [Qemu-devel] [Qemu-block] [PATCH RFC v3 3/8] block: add throttle block filter driver

2017-06-27 Thread Manos Pitsidianakis
On Tue, Jun 27, 2017 at 01:45:40PM +0100, Stefan Hajnoczi wrote: On Mon, Jun 26, 2017 at 07:26:41PM +0300, Manos Pitsidianakis wrote: On Mon, Jun 26, 2017 at 03:30:55PM +0100, Stefan Hajnoczi wrote: > > +bs->file = bdrv_open_child(NULL, optio

Re: [Qemu-devel] [PATCH RFC v3 1/8] block: move ThrottleGroup membership to ThrottleGroupMember

2017-06-27 Thread Manos Pitsidianakis
On Tue, Jun 27, 2017 at 02:08:54PM +0200, Alberto Garcia wrote: On Fri 23 Jun 2017 02:46:53 PM CEST, Manos Pitsidianakis wrote: This commit gathers ThrottleGroup membership details from BlockBackendPublic into ThrottleGroupMember and refactors existing code to use the structure. Signed-off

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

2017-06-26 Thread Manos Pitsidianakis
On Mon, Jun 26, 2017 at 04:44:44PM +0100, Stefan Hajnoczi wrote: On Fri, Jun 23, 2017 at 03:46:59PM +0300, Manos Pitsidianakis wrote: -void blk_io_limits_disable(BlockBackend *blk) +void blk_io_limits_disable(BlockBackend *blk, Error **errp) { -assert(blk

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

2017-06-26 Thread Manos Pitsidianakis
On Mon, Jun 26, 2017 at 03:52:34PM +0100, Stefan Hajnoczi wrote: On Fri, Jun 23, 2017 at 03:46:56PM +0300, Manos Pitsidianakis wrote: +static bool throttle_group_exists(const char *name) +{ +ThrottleGroup *iter; +bool ret = false; + +qemu_mutex_lock(_groups_lock); Not sure

Re: [Qemu-devel] [Qemu-block] [PATCH RFC v3 3/8] block: add throttle block filter driver

2017-06-26 Thread Manos Pitsidianakis
On Mon, Jun 26, 2017 at 03:30:55PM +0100, Stefan Hajnoczi wrote: +bs->file = bdrv_open_child(NULL, options, "file", +bs, _file, false, _err); + +if (local_err) { +error_propagate(errp, local_err); +return -EINVAL; +} + +

Re: [Qemu-devel] [Qemu-block] [PATCH RFC v3 3/8] block: add throttle block filter driver

2017-06-26 Thread Manos Pitsidianakis
On Mon, Jun 26, 2017 at 03:30:55PM +0100, Stefan Hajnoczi wrote: +static BlockDriver bdrv_throttle = { +.format_name= "throttle", +.protocol_name = "throttle", +.instance_size = sizeof(ThrottleGroupMember), + +

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

2017-06-26 Thread Manos Pitsidianakis
On Mon, Jun 26, 2017 at 03:52:34PM +0100, Stefan Hajnoczi wrote: Have you seen iothread.c:qmp_query_iothreads()? All objects are put into a container (the parent object), so you can just iterate over its children. There's no need for a separate list because QOM already has all the objects.

Re: [Qemu-devel] [Qemu-block] [PATCH RFC v3 2/8] block: Add aio_context field in ThrottleGroupMember

2017-06-26 Thread Manos Pitsidianakis
On Mon, Jun 26, 2017 at 02:36:11PM +0100, Stefan Hajnoczi wrote: On Fri, Jun 23, 2017 at 03:46:54PM +0300, Manos Pitsidianakis wrote: 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

Re: [Qemu-devel] [Qemu-block] [PATCH RFC v3 3/8] block: add throttle block filter driver

2017-06-26 Thread Manos Pitsidianakis
On Fri, Jun 23, 2017 at 03:46:55PM +0300, Manos Pitsidianakis wrote: +static QemuOptsList throttle_opts = { +.name = "throttle", +.head = QTAILQ_HEAD_INITIALIZER(throttle_opts.head), +.desc = { +{ +.name = QEMU_OPT_IOPS_TOTAL, throttle_opts

[Qemu-devel] [PATCH RFC v3 1/8] block: move ThrottleGroup membership to ThrottleGroupMember

2017-06-23 Thread Manos Pitsidianakis
This commit gathers ThrottleGroup membership details from BlockBackendPublic into ThrottleGroupMember and refactors existing code to use the structure. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block/block-backend.c | 66 + block/

[Qemu-devel] [PATCH RFC v3 3/8] block: add throttle block filter driver

2017-06-23 Thread Manos Pitsidianakis
=... The configuration flags and semantics are identical to the hardcoded throttling ones. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block/Makefile.objs | 1 + block/throttle.c| 427 include/qemu/th

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

2017-06-23 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 RFC v3 8/8] block: add throttle block filter driver interface tests

2017-06-23 Thread Manos Pitsidianakis
Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- tests/qemu-iotests/184 | 144 + tests/qemu-iotests/184.out | 31 ++ tests/qemu-iotests/group | 1 + 3 files changed, 176 insertions(+) create mode 100755 tests/qemu-i

[Qemu-devel] [PATCH RFC v3 6/8] block: add options parameter to bdrv_new_open_driver()

2017-06-23 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-devel] [PATCH RFC v3 0/8] I/O Throtting block filter driver

2017-06-23 Thread Manos Pitsidianakis
object - convert legacy interface to use the driver - add tests Manos Pitsidianakis (8): block: move ThrottleGroup membership to ThrottleGroupMember block: Add aio_context field in ThrottleGroupMember block: add throttle block filter driver block: convert ThrottleGroup to object with QOM

[Qemu-devel] [PATCH RFC v3 5/8] block: add BlockDevOptionsThrottle to QAPI

2017-06-23 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 | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json

[Qemu-devel] [PATCH RFC v3 2/8] block: Add aio_context field in ThrottleGroupMember

2017-06-23 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-devel] [PATCH RFC v3 4/8] block: convert ThrottleGroup to object with QOM

2017-06-23 Thread Manos Pitsidianakis
ThrottleGroup is converted to an object to allow easy runtime configuration of throttling filter nodes in the BDS graph using QOM. Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> --- block/throttle-groups.c | 351 include/qemu/thro

Re: [Qemu-devel] [PATCH 1/1] Add support for custom fmasks/dmasks in 9ps mapped mode

2017-06-18 Thread Manos Pitsidianakis
On Sun, Jun 18, 2017 at 10:28:13AM +0200, Tobias Schramm wrote: @@ -1469,6 +1472,28 @@ static int local_parse_opts(QemuOpts *opts, struct FsDriverEntry *fse) fse->path = g_strdup(path); +fse->fmask = SM_LOCAL_MODE_BITS; +if (fmask) { +mask = strtol(fmask, NULL, 0); (Use

Re: [Qemu-devel] [Qemu-block] [PATCH v2 30/31] qed: Use bdrv_co_* for coroutine_fns

2017-06-17 Thread Manos Pitsidianakis
Reviewed-by: Manos Pitsidianakis <el13...@mail.ntua.gr> On Fri, Jun 16, 2017 at 07:37:15PM +0200, Kevin Wolf wrote: All functions that are marked coroutine_fn can directly call the bdrv_co_* version of functions instead of going through the wrapper. Signed-off-by: Kevin Wolf <kw...@r

Re: [Qemu-devel] [Qemu-block] [PATCH v2 25/31] qed: Implement .bdrv_co_readv/writev

2017-06-17 Thread Manos Pitsidianakis
Reviewed-by: Manos Pitsidianakis <el13...@mail.ntua.gr> On Fri, Jun 16, 2017 at 07:37:10PM +0200, Kevin Wolf wrote: Most of the qed code is now synchronous and matches the coroutine model. One notable exception is the serialisation between requests which can still schedule a callback. Bef

<    1   2   3   4   5   6   7   >