[libvirt] [PATCH 3/4] qemuDomainAgentJob: Introduce query and modify jobs
John Ferlan
jferlan at redhat.com
Wed Jun 13 22:11:50 UTC 2018
On 06/08/2018 09:45 AM, Michal Privoznik wrote:
> These jobs can be used to mark job type over qemu agent.
>
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
> src/qemu/qemu_domain.c | 4 +++-
> src/qemu/qemu_domain.h | 2 ++
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index 09404f6569..e5e11f0cb7 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -94,7 +94,9 @@ VIR_ENUM_IMPL(qemuDomainJob, QEMU_JOB_LAST,
> );
>
> VIR_ENUM_IMPL(qemuDomainAgentJob, QEMU_AGENT_JOB_LAST,
> - "none"
> + "none",
> + "query",
> + "modify",
> );
>
> VIR_ENUM_IMPL(qemuDomainAsyncJob, QEMU_ASYNC_JOB_LAST,
> diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
> index 6ada26ca99..f2759951e5 100644
> --- a/src/qemu/qemu_domain.h
> +++ b/src/qemu/qemu_domain.h
> @@ -84,6 +84,8 @@ VIR_ENUM_DECL(qemuDomainJob)
>
> typedef enum {
> QEMU_AGENT_JOB_NONE = 0, /* No agent job. */
> + QEMU_AGENT_JOB_QUERY, /* Does not change state of domain */
> + QEMU_AGENT_JOB_MODIFY, /* May change state of domain */
Seems there are 2 classes of MODIFY - one is just agent modify and one
is agent and normal modify. Maybe a QEMU_AGENT_JOB_MODIFY_BLOCK would
provide some clarity or easier to read code. A MODIFY_BLOCK ensures a
normal job cannot occur at the same time because something being done
(reboot, shutdown, and settime currently).
Then the black magic for starting both a normal and an agent job is left
to qemuDomainObjBeginAgentJob obviating qemuDomainObjBeginJobWithAgent.
Simmilarly, the specific logic in EndJobWithAgent for is used when
agentActive == MODIFY_BLOCK
>
> QEMU_AGENT_JOB_LAST
> } qemuDomainAgentJob;
>
As noted earlier, this should just be merged into patch 1.
John
More information about the libvir-list
mailing list