From: "Wangjing(Hogan)" via <qemu-devel@nongnu.org>
To: Markus Armbruster <armbru@redhat.com>
Cc: "kwolf@redhat.com" <kwolf@redhat.com>,
"berrange@redhat.com" <berrange@redhat.com>,
"marcandre.lureau@redhat.com" <marcandre.lureau@redhat.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"Wangxin (Alexander)" <wangxinxin.wang@huawei.com>
Subject: Re: [PATCH v4 2/3] job: introduce dump guest memory job
Date: Tue, 2 Aug 2022 01:44:46 +0000 [thread overview]
Message-ID: <6eeba8d025bf4ecf86abf66a828d4a2c@huawei.com> (raw)
> Hogan Wang <hogan.wang@huawei.com> writes:
>
> > There's no way to cancel the current executing dump process, lead to
> > the virtual machine manager daemon((e.g. libvirtd) cannot restore the
> > dump job after daemon restart.
> >
> > Introduce dump guest memory job type, and add an optional 'job-id'
> > argument for dump-guest-memory QMP to make use of jobs framework.
> >
> > Signed-off-by: Hogan Wang <hogan.wang@huawei.com>
> > ---
> > dump/dump-hmp-cmds.c | 12 ++++++++++--
> > dump/dump.c | 1 +
> > qapi/dump.json | 6 +++++-
> > qapi/job.json | 5 ++++-
> > 4 files changed, 20 insertions(+), 4 deletions(-)
> >
> > @@ -62,10 +64,16 @@ void hmp_dump_guest_memory(Monitor *mon, const QDict *qdict)
> > detach = qdict_get_bool(qdict, "detach");
> > }
> >
> > + if (has_job_id) {
> > + job_id = qdict_get_str(qdict, "job-id");
> > + }
> > +
>
> Simpler:
>
> const char *job_id = qdict_get_try_str(qdict, "job-id");
>
> > prot = g_strconcat("file:", file, NULL);
> >
> > - qmp_dump_guest_memory(paging, prot, true, detach, has_begin, begin,
> > - has_length, length, true, dump_format, &err);
> > + qmp_dump_guest_memory(paging, prot, has_job_id, job_id,
>
> This becomes
>
> qmp_dump_guest_memory(paging, prot, !!job_id, job_id,
>
> then.
>
Accept the improvements.
> > --- a/qapi/dump.json
> > +++ b/qapi/dump.json
> > @@ -59,6 +59,9 @@
> > # 2. fd: the protocol starts with "fd:", and the following string
> > # is the fd's name.
> > #
> > +# @job-id: identifier for the newly-created memory dump job. To be compatible
> > +# with legacy dump process, @job-id should omitted. (Since 7.2)
> > +#
>
> I think we need to describe things in more detail.
>
> What are the behavioral differences between dumping with and without @job-id?
>
> Why would you want to pass @job-id? I figure it's to gain the ability to monitor and control dump task with query-job, job-cancel, ...
>
Thanks for your review comments, I will write the detailed comment for @job-id in patch set for the next version.
> > # @detach: if true, QMP will return immediately rather than
> > # waiting for the dump to finish. The user can track progress
> > # using "query-dump". (since 2.6).
>
> Hmm, does "detach": false make any sense when "job-id" is present?
>
I had tested in my environment, "detach": false haven't got any sense when "job-id" is present,cann't cancel and query the job.
I will delete the code condition branch for non-detach dump job.
> Preexisting: @detach's default is undocumented.
Hogan Wang
next reply other threads:[~2022-08-02 1:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-02 1:44 Wangjing(Hogan) via [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-08-01 8:07 [PATCH v4 1/3] dump: support cancel dump process Hogan Wang via
2022-08-01 8:07 ` [PATCH v4 2/3] job: introduce dump guest memory job Hogan Wang via
2022-08-01 13:01 ` Markus Armbruster
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=6eeba8d025bf4ecf86abf66a828d4a2c@huawei.com \
--to=qemu-devel@nongnu.org \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=hogan.wang@huawei.com \
--cc=kwolf@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=wangxinxin.wang@huawei.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.