Re: [Qemu-devel] [PATCH v9 03/11] block: use the block job list in qmp_query_block_jobs()
On Fri 29 Apr 2016 04:32:41 PM CEST, Kevin Wolf wrote: > However, I'd like to give you a heads-up that this will technically > conflict with my series that removes BlockDriverState.blk because that > changes the bdrv_next() signature. > > Nothing dramatic, but I guess it would make sense to decide where in > the queue of patches this series should go. My suggestion would be on > top of "blockdev: (Nearly) free clean-up work". Okay, thanks. Berto
Re: [Qemu-devel] [PATCH v9 03/11] block: use the block job list in qmp_query_block_jobs()
Am 04.04.2016 um 15:43 hat Alberto Garcia geschrieben: > qmp_query_block_jobs() uses bdrv_next() to look for block jobs, but > this function can only find those in top-level BlockDriverStates. > > This patch uses block_job_next() instead. > > Signed-off-by: Alberto GarciaReviewed-by: Kevin Wolf However, I'd like to give you a heads-up that this will technically conflict with my series that removes BlockDriverState.blk because that changes the bdrv_next() signature. Nothing dramatic, but I guess it would make sense to decide where in the queue of patches this series should go. My suggestion would be on top of "blockdev: (Nearly) free clean-up work". Kevin
Re: [Qemu-devel] [PATCH v9 03/11] block: use the block job list in qmp_query_block_jobs()
On 04.04.2016 15:43, Alberto Garcia wrote: > qmp_query_block_jobs() uses bdrv_next() to look for block jobs, but > this function can only find those in top-level BlockDriverStates. > > This patch uses block_job_next() instead. > > Signed-off-by: Alberto Garcia> --- > blockdev.c | 19 --- > 1 file changed, 8 insertions(+), 11 deletions(-) Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature
[Qemu-devel] [PATCH v9 03/11] block: use the block job list in qmp_query_block_jobs()
qmp_query_block_jobs() uses bdrv_next() to look for block jobs, but this function can only find those in top-level BlockDriverStates. This patch uses block_job_next() instead. Signed-off-by: Alberto Garcia--- blockdev.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/blockdev.c b/blockdev.c index e50e8ea..edbcc19 100644 --- a/blockdev.c +++ b/blockdev.c @@ -4083,21 +4083,18 @@ out: BlockJobInfoList *qmp_query_block_jobs(Error **errp) { BlockJobInfoList *head = NULL, **p_next = -BlockDriverState *bs; +BlockJob *job; -for (bs = bdrv_next(NULL); bs; bs = bdrv_next(bs)) { -AioContext *aio_context = bdrv_get_aio_context(bs); +for (job = block_job_next(NULL); job; job = block_job_next(job)) { +BlockJobInfoList *elem = g_new0(BlockJobInfoList, 1); +AioContext *aio_context = bdrv_get_aio_context(job->bs); aio_context_acquire(aio_context); - -if (bs->job) { -BlockJobInfoList *elem = g_new0(BlockJobInfoList, 1); -elem->value = block_job_query(bs->job); -*p_next = elem; -p_next = >next; -} - +elem->value = block_job_query(job); aio_context_release(aio_context); + +*p_next = elem; +p_next = >next; } return head; -- 2.8.0.rc3