]> xenbits.xensource.com Git - libvirt.git/commitdiff
virDomainDefFormatInternal: Drop useless check
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 22 Feb 2016 06:59:25 +0000 (07:59 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 22 Feb 2016 06:59:25 +0000 (07:59 +0100)
There's a check if a domain definition has any graphics card and
if so, we iterate over each one of them. This makes no sense,
because even if it has none we can still iterate over.

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

index e47d613cca6ac676f79faf4ce2e69a8c3b2ef1a6..56bd1aa990425aa4508c18f9fbb685e972627b2f 100644 (file)
@@ -22363,11 +22363,9 @@ virDomainDefFormatInternal(virDomainDefPtr def,
             goto error;
     }
 
-    if (def->ngraphics > 0) {
-        for (n = 0; n < def->ngraphics; n++)
-            if (virDomainGraphicsDefFormat(buf, def->graphics[n], flags) < 0)
-                goto error;
-    }
+    for (n = 0; n < def->ngraphics; n++)
+        if (virDomainGraphicsDefFormat(buf, def->graphics[n], flags) < 0)
+            goto error;
 
     for (n = 0; n < def->nsounds; n++)
         if (virDomainSoundDefFormat(buf, def->sounds[n], flags) < 0)