]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: fix build with musl libc
authorCarlos Santos <casantos@redhat.com>
Wed, 16 Oct 2019 11:22:13 +0000 (08:22 -0300)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 17 Oct 2019 08:54:32 +0000 (10:54 +0200)
On musl libc "stderr" is a preprocessor macro whose expansion leads to
compilation errors:

In file included from qemu/qemu_process.c:66:
qemu/qemu_process.c: In function 'qemuProcessQMPFree':
qemu/qemu_process.c:8418:21: error: expected identifier before '(' token
     VIR_FREE((proc->stderr));
                     ^~~~~~

Prevent this by renaming the homonymous field in the _qemuProcessQMP
struct to "stdErr".

Signed-off-by: Carlos Santos <casantos@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_process.c
src/qemu/qemu_process.h

index aaca2fc7d64f7b68878a083129995a7e3af747b7..9eaea4edfd1844017ffcd460dc939248b69e2977 100644 (file)
@@ -8445,7 +8445,7 @@ qemuProcessQMPFree(qemuProcessQMPPtr proc)
     VIR_FREE(proc->monpath);
     VIR_FREE(proc->monarg);
     VIR_FREE(proc->pidfile);
-    VIR_FREE(proc->stderr);
+    VIR_FREE(proc->stdErr);
     VIR_FREE(proc);
 }
 
@@ -8598,7 +8598,7 @@ qemuProcessQMPLaunch(qemuProcessQMPPtr proc)
     virCommandSetGID(proc->cmd, proc->runGid);
     virCommandSetUID(proc->cmd, proc->runUid);
 
-    virCommandSetErrorBuffer(proc->cmd, &(proc->stderr));
+    virCommandSetErrorBuffer(proc->cmd, &(proc->stdErr));
 
     if (virCommandRun(proc->cmd, &status) < 0)
         goto cleanup;
@@ -8608,7 +8608,7 @@ qemuProcessQMPLaunch(qemuProcessQMPPtr proc)
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to start QEMU binary %s for probing: %s"),
                        proc->binary,
-                       proc->stderr ? proc->stderr : _("unknown error"));
+                       proc->stdErr ? proc->stdErr : _("unknown error"));
         goto cleanup;
     }
 
@@ -8687,7 +8687,7 @@ qemuProcessQMPConnectMonitor(qemuProcessQMPPtr proc)
  *   ** Send QMP Queries to QEMU using monitor (proc->mon) **
  *   qemuProcessQMPFree(proc);
  *
- * Process error output (proc->stderr) remains available in qemuProcessQMP
+ * Process error output (proc->stdErr) remains available in qemuProcessQMP
  * struct until qemuProcessQMPFree is called.
  */
 int
index 1d62319092c3908422436ed8fa93368d210a5df6..9af9f967fd99eea38673dc9729f3bf6f2a799e1c 100644 (file)
@@ -212,7 +212,7 @@ struct _qemuProcessQMP {
     char *libDir;
     uid_t runUid;
     gid_t runGid;
-    char *stderr;
+    char *stdErr;
     char *monarg;
     char *monpath;
     char *pidfile;