Re: [libvirt] [PATCH RFC 04/22] qemu_process: Refer to proc not cmd in process code

2018-11-27 Thread Jiri Denemark
On Sun, Nov 11, 2018 at 13:59:12 -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 
> ---
>  src/qemu/qemu_capabilities.c |  14 ++--
>  src/qemu/qemu_process.c  | 140 +--
>  src/qemu/qemu_process.h  |   6 +-
>  3 files changed, 80 insertions(+), 80 deletions(-)

OK

Jirka

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH RFC 04/22] qemu_process: Refer to proc not cmd in process code

2018-11-12 Thread Michal Privoznik
On 11/11/2018 08:59 PM, 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 
> ---
>  src/qemu/qemu_capabilities.c |  14 ++--
>  src/qemu/qemu_process.c  | 140 +--
>  src/qemu/qemu_process.h  |   6 +-
>  3 files changed, 80 insertions(+), 80 deletions(-)
> 
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index f6d97648ce..1ea63000e2 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -4219,7 +4219,7 @@ virQEMUCapsInitQMP(virQEMUCapsPtr qemuCaps,
> gid_t runGid,
> char **qmperr)
>  {
> -qemuProcessPtr cmd = NULL;
> +qemuProcessPtr proc = NULL;
>  int ret = -1;
>  int rc;

This is actually the place where the problem I've raised in 02/22 should
be addressed. s/cmd/proc/ should happen here.

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


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

2018-11-11 Thread Chris Venteicher
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 
---
 src/qemu/qemu_capabilities.c |  14 ++--
 src/qemu/qemu_process.c  | 140 +--
 src/qemu/qemu_process.h  |   6 +-
 3 files changed, 80 insertions(+), 80 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index f6d97648ce..1ea63000e2 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -4219,7 +4219,7 @@ virQEMUCapsInitQMP(virQEMUCapsPtr qemuCaps,
gid_t runGid,
char **qmperr)
 {
-qemuProcessPtr cmd = NULL;
+qemuProcessPtr proc = NULL;
 int ret = -1;
 int rc;
 
@@ -4227,31 +4227,31 @@ virQEMUCapsInitQMP(virQEMUCapsPtr qemuCaps,
 runUid, runGid, qmperr)))
 goto cleanup;
 
-if ((rc = qemuProcessRun(cmd, false)) != 0) {
+if ((rc = qemuProcessRun(proc, false)) != 0) {
 if (rc == 1)
 ret = 0;
 goto cleanup;
 }
 
-if (virQEMUCapsInitQMPMonitor(qemuCaps, cmd->mon) < 0)
+if (virQEMUCapsInitQMPMonitor(qemuCaps, proc->mon) < 0)
 goto cleanup;
 
 if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) {
-qemuProcessAbort(cmd);
-if ((rc = qemuProcessRun(cmd, true)) != 0) {
+qemuProcessAbort(proc);
+if ((rc = qemuProcessRun(proc, true)) != 0) {
 if (rc == 1)
 ret = 0;
 goto cleanup;
 }
 
-if (virQEMUCapsInitQMPMonitorTCG(qemuCaps, cmd->mon) < 0)
+if (virQEMUCapsInitQMPMonitorTCG(qemuCaps, proc->mon) < 0)
 goto cleanup;
 }
 
 ret = 0;
 
  cleanup:
-qemuProcessFree(cmd);
+qemuProcessFree(proc);
 return ret;
 }
 
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 2f9726d463..e949547124 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -8081,17 +8081,17 @@ static qemuMonitorCallbacks callbacks = {
 
 
 void
-qemuProcessFree(qemuProcessPtr cmd)
+qemuProcessFree(qemuProcessPtr proc)
 {
-if (!cmd)
+if (!proc)
 return;
 
-qemuProcessAbort(cmd);
-VIR_FREE(cmd->binary);
-VIR_FREE(cmd->monpath);
-VIR_FREE(cmd->monarg);
-VIR_FREE(cmd->pidfile);
-VIR_FREE(cmd);
+qemuProcessAbort(proc);
+VIR_FREE(proc->binary);
+VIR_FREE(proc->monpath);
+VIR_FREE(proc->monarg);
+VIR_FREE(proc->pidfile);
+VIR_FREE(proc);
 }
 
 
@@ -8102,25 +8102,25 @@ qemuProcessNew(const char *binary,
gid_t runGid,
char **qmperr)
 {
-qemuProcessPtr cmd = NULL;
+qemuProcessPtr proc = NULL;
 
-if (VIR_ALLOC(cmd) < 0)
+if (VIR_ALLOC(proc) < 0)
 goto error;
 
-if (VIR_STRDUP(cmd->binary, binary) < 0)
+if (VIR_STRDUP(proc->binary, binary) < 0)
 goto error;
 
-cmd->runUid = runUid;
-cmd->runGid = runGid;
-cmd->qmperr = qmperr;
+proc->runUid = runUid;
+proc->runGid = runGid;
+proc->qmperr = qmperr;
 
 /* the ".sock" sufix is important to avoid a possible clash with a qemu
  * domain called "capabilities"
  */
-if (virAsprintf(&cmd->monpath, "%s/%s", libDir,
+if (virAsprintf(&proc->monpath, "%s/%s", libDir,
 "capabilities.monitor.sock") < 0)
 goto error;
-if (virAsprintf(&cmd->monarg, "unix:%s,server,nowait", cmd->monpath) < 0)
+if (virAsprintf(&proc->monarg, "unix:%s,server,nowait", proc->monpath) < 0)
 goto error;
 
 /* ".pidfile" suffix is used rather than ".pid" to avoid a possible clash
@@ -8129,19 +8129,19 @@ qemuProcessNew(const char *binary,
  * -daemonize we need QEMU to be allowed to create them, rather
  * than libvirtd. So we're using libDir which QEMU can write to
  */
-if (virAsprintf(&cmd->pidfile, "%s/%s", libDir, "capabilities.pidfile") < 
0)
+if (virAsprintf(&proc->pidfile, "%s/%s", libDir, "capabilities.pidfile") < 
0)
 goto error;
 
-virPidFileForceCleanupPath(cmd->pidfile);
+virPidFileForceCleanupPath(proc->pidfile);
 
-cmd->config.type = VIR_DOMAIN_CHR_TYPE_UNIX;
-cmd->config.data.nix.path = cmd->monpath;
-cmd->config.data.nix.listen = false;
+proc->config.type = VIR_DOMAIN_CHR_TYPE_UNIX;
+proc->config.data.nix.path = proc->monpath;
+proc->config.data.nix.listen = false;
 
-return cmd;
+return proc;
 
  error:
-qemuProcessFree(cmd);
+qemuProcessFree(proc);
 return NULL;
 }
 
@@ -8151,7 +8151,7 @@ qemuProcessNew(const char *binary,
  *  1 when pr