]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuBuildCommandLine: Change the condition for -nographics
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 23 Feb 2016 08:38:26 +0000 (09:38 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 23 Feb 2016 14:48:37 +0000 (15:48 +0100)
There's this check when building command line that whenever
domain has no graphics card configured we put -nographics onto
qemu command line. The check is 'if (!def->graphics)'. This
makes coverity think that def->graphics can be NULL, which is
true. But later in the code every access to def->graphics is
guarded by check for def->ngraphics, so no crash occurs. But this
is something that coverity fails to deduct.
In order to shut coverity up lets change the condition to
'if (!def->ngraphics)'.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_command.c

index 78423e7046d92c764e6dba485084bd2d18cacade..854e51c60b60800bf20083de32fc3f873128d901 100644 (file)
@@ -7130,7 +7130,7 @@ qemuBuildCommandLine(virConnectPtr conn,
      * if you ask for nographic. So we have to make sure we override
      * these defaults ourselves...
      */
-    if (!def->graphics) {
+    if (!def->ngraphics) {
         virCommandAddArg(cmd, "-nographic");
 
         if (cfg->nogfxAllowHostAudio)