On 22.06.2015 23:32, Alberto Garcia wrote:
The current way to obtain the list of existing block jobs is to
iterate over all root nodes and check which ones own a job.

Since we want to be able to support block jobs in other nodes as well,
this patch keeps a list of jobs that is updated every time one is
created or destroyed.

This also updates qmp_query_block_jobs() and bdrv_drain_all() to use
this new list.

Signed-off-by: Alberto Garcia <be...@igalia.com>
Cc: Max Reitz <mre...@redhat.com>
Cc: Eric Blake <ebl...@redhat.com>
Cc: Alexander Yarygin <yary...@linux.vnet.ibm.com>
---
  block/io.c               | 22 +++++++++++-----------
  blockdev.c               | 19 ++++++++-----------
  blockjob.c               | 13 +++++++++++++
  include/block/blockjob.h | 14 ++++++++++++++
  4 files changed, 46 insertions(+), 22 deletions(-)

Reviewed-by: Max Reitz <mre...@redhat.com>

Reply via email to