[libvirt] [PATCH] qemu: Fix job entry debug message

Peter Krempa pkrempa at redhat.com
Wed Nov 11 14:22:36 UTC 2015


On Wed, Nov 11, 2015 at 15:15:56 +0100, Jiri Denemark wrote:
> Logging current async job while in BeginJob is useful, but the async job
> we want to start is even more interesting.

A little confusing on the first read.

> 
> Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
> ---
>  src/qemu/qemu_domain.c | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index 416ab5b..0a7437a 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -1476,17 +1476,23 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver,
>      unsigned long long now;
>      unsigned long long then;
>      bool nested = job == QEMU_JOB_ASYNC_NESTED;
> +    bool async = job == QEMU_JOB_ASYNC;
>      virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
>      const char *blocker = NULL;
>      int ret = -1;
>      unsigned long long duration = 0;
>      unsigned long long asyncDuration = 0;
> +    const char *jobStr;
>  
> -    VIR_DEBUG("Starting %s: %s (async=%s vm=%p name=%s)",
> -              job == QEMU_JOB_ASYNC ? "async job" : "job",
> -              qemuDomainJobTypeToString(job),
> -              qemuDomainAsyncJobTypeToString(priv->job.asyncJob),
> -              obj, obj->def->name);
> +    if (async)
> +        jobStr = qemuDomainAsyncJobTypeToString(asyncJob);
> +    else
> +        jobStr = qemuDomainJobTypeToString(job);
> +
> +    VIR_DEBUG("Starting %s: %s (vm=%p name=%s, current job=%s async=%s)",
> +              async ? "async job" : "job", jobStr, obj, obj->def->name,
> +              qemuDomainJobTypeToString(priv->job.active),
> +              qemuDomainAsyncJobTypeToString(priv->job.asyncJob));

ACK,

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20151111/5a117f06/attachment-0001.sig>


More information about the libvir-list mailing list