[libvirt] [PATCH v5 04/36] qemu_process: Refer to proc not cmd in process code

Jiri Denemark jdenemar at redhat.com
Thu Jan 3 14:12:59 UTC 2019


On Sun, Dec 02, 2018 at 23:09:58 -0600, Chris Venteicher wrote:
> s/cmd/proc/ in process code imported from qemu_capabilities.
> 
> No functionality is changed.  Just variable renaming.
> 
> Process code imported from qemu_capabilities was oriented around
> starting a process to issue a single QMP command.
> 
> Future usecases (ex. baseline, compare) expect to use a single process
> to issue multiple different QMP commands.
> 
> This patch changes the variable naming from cmd to proc to put focus
> on the process being maintained to issue commands.
> 
> Signed-off-by: Chris Venteicher <cventeic at redhat.com>
> ---
>  src/qemu/qemu_capabilities.c |  18 ++---
>  src/qemu/qemu_process.c      | 138 +++++++++++++++++------------------
>  src/qemu/qemu_process.h      |   4 +-
>  3 files changed, 80 insertions(+), 80 deletions(-)
...
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index 46aed4fc9c..5f4853e0c4 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
...
> @@ -8201,55 +8201,55 @@ qemuProcessQmpRun(qemuProcessQmpPtr cmd,
...
>      if (!(xmlopt = virDomainXMLOptionNew(NULL, NULL, NULL, NULL, NULL)) ||
> -        !(cmd->vm = virDomainObjNew(xmlopt)))
> +        !(proc->vm = virDomainObjNew(xmlopt)))
>          goto cleanup;
>  
> -    cmd->vm->pid = cmd->pid;
> +    proc->vm->pid = proc->pid;
>  
> -    if (!(cmd->mon = qemuMonitorOpen(cmd->vm, &cmd->config, true, true,
> +    if (!(proc->mon = qemuMonitorOpen(proc->vm, &proc->config, true, true,
>                                       0, &callbacks, NULL)))

You forgot to update the indentation of the line above.

>          goto ignore;
>  
> -    virObjectLock(cmd->mon);
> +    virObjectLock(proc->mon);
>  
>      ret = 0;
>  
>   cleanup:
> -    if (!cmd->mon)
> -        qemuProcessQmpAbort(cmd);
> +    if (!proc->mon)
> +        qemuProcessQmpAbort(proc);
>      virObjectUnref(xmlopt);
>  
>      return ret;
...

After fixing that and doing s/Qmp/QMP/g

Reviewed-by: Jiri Denemark <jdenemar at redhat.com>




More information about the libvir-list mailing list