From: John Snow <jsnow@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, pkrempa@redhat.com, jtc@redhat.com,
qemu-devel@nongnu.org, John Snow <jsnow@redhat.com>
Subject: [Qemu-devel] [PATCH 2/3] qmp: add block-job-cull command
Date: Mon, 2 Oct 2017 23:15:55 -0400 [thread overview]
Message-ID: <20171003031556.15173-3-jsnow@redhat.com> (raw)
In-Reply-To: <20171003031556.15173-1-jsnow@redhat.com>
For jobs that have finished (either completed or canceled), allow the
user to dismiss the job's status reports via block-job-cull.
Signed-off-by: John Snow <jsnow@redhat.com>
---
block/trace-events | 1 +
blockdev.c | 14 ++++++++++++++
qapi/block-core.json | 21 +++++++++++++++++++++
3 files changed, 36 insertions(+)
diff --git a/block/trace-events b/block/trace-events
index 25dd5a3..cb64e91 100644
--- a/block/trace-events
+++ b/block/trace-events
@@ -46,6 +46,7 @@ qmp_block_job_cancel(void *job) "job %p"
qmp_block_job_pause(void *job) "job %p"
qmp_block_job_resume(void *job) "job %p"
qmp_block_job_complete(void *job) "job %p"
+qmp_block_job_cull(void *job) "job %p"
qmp_block_stream(void *bs, void *job) "bs %p job %p"
# block/file-win32.c
diff --git a/blockdev.c b/blockdev.c
index eeb4986..ee07bca 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -3766,6 +3766,20 @@ void qmp_block_job_complete(const char *device, Error **errp)
aio_context_release(aio_context);
}
+void qmp_block_job_cull(const char *device, Error **errp)
+{
+ AioContext *aio_context;
+ BlockJob *job = find_block_job(device, &aio_context, errp);
+
+ if (!job) {
+ return;
+ }
+
+ trace_qmp_block_job_cull(job);
+ block_job_cull(&job, errp);
+ aio_context_release(aio_context);
+}
+
void qmp_change_backing_file(const char *device,
const char *image_node_name,
const char *backing_file,
diff --git a/qapi/block-core.json b/qapi/block-core.json
index a4f5e10..de322d1 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -2161,6 +2161,27 @@
{ 'command': 'block-job-complete', 'data': { 'device': 'str' } }
##
+# @block-job-cull:
+#
+# For jobs that have already completed, remove them from the block-job-query
+# list. This command only needs to be run for jobs which were started with the
+# manual-cull=true option.
+#
+# This command will refuse to operate on any job that has not yet reached
+# its terminal state. "cancel" or "complete" will still need to be used as
+# appropriate.
+#
+# @device: The job identifier. This used to be a device name (hence
+# the name of the parameter), but since QEMU 2.7 it can have
+# other values.
+#
+# Returns: Nothing on success
+#
+# Since: 2.11
+##
+{ 'command': 'block-job-cull', 'data': { 'device': 'str' } }
+
+##
# @BlockdevDiscardOptions:
#
# Determines how to handle discard requests.
--
2.9.5
next prev parent reply other threads:[~2017-10-03 3:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-03 3:15 [Qemu-devel] [PATCH 0/3] blockjobs: add explicit job culling John Snow
2017-10-03 3:15 ` [Qemu-devel] [PATCH 1/3] blockjob: add manual-cull property John Snow
2017-10-03 3:15 ` John Snow [this message]
2017-10-03 3:15 ` [Qemu-devel] [PATCH 3/3] blockjob: expose " John Snow
2017-10-03 15:57 ` Paolo Bonzini
2017-10-03 15:59 ` John Snow
2017-10-03 17:43 ` Jeff Cody
2017-10-04 1:32 ` John Snow
2017-10-03 9:20 ` [Qemu-devel] [PATCH 0/3] blockjobs: add explicit job culling Vladimir Sementsov-Ogievskiy
2017-10-03 14:42 ` John Snow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171003031556.15173-3-jsnow@redhat.com \
--to=jsnow@redhat.com \
--cc=jtc@redhat.com \
--cc=kwolf@redhat.com \
--cc=pkrempa@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).