]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix building with -Og
authorMartin Kletzander <mkletzan@redhat.com>
Fri, 3 Jun 2016 11:26:30 +0000 (13:26 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Fri, 3 Jun 2016 11:26:30 +0000 (13:26 +0200)
When building using -Og, gcc sees that some variables can be used
uninitialized  It can be debatable whether it is possible with our
codeflow, but functions should be self-contained and initializations are
always good.  The return instead of goto is due to actualType being used
in the cleanup.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/lxc/lxc_driver.c
src/nwfilter/nwfilter_ebiptables_driver.c
src/util/virbitmap.c

index 67f14fe766a54f6ad8620fc65df4b1e1c29c7f38..f0948eae774e196a091659f2e4b7d7d1a504065a 100644 (file)
@@ -4275,7 +4275,7 @@ lxcDomainAttachDeviceNetLive(virConnectPtr conn,
     if (!priv->initpid) {
         virReportError(VIR_ERR_OPERATION_INVALID, "%s",
                        _("Cannot attach disk until init PID is known"));
-        goto cleanup;
+        return -1;
     }
 
     if (virLXCProcessValidateInterface(net) < 0)
index 423d069e1b268eb60fc61b44e2b3244bacbeb596..b7be2917e29e309c6deefadccb5738b4d31bf98d 100644 (file)
@@ -1570,7 +1570,7 @@ iptablesCreateRuleInstanceStateCtrl(virFirewallPtr fw,
                                     const char *ifname,
                                     virNWFilterVarCombIterPtr vars)
 {
-    int rc;
+    int rc = 0;
     bool directionIn = false;
     char chainPrefix[2];
     bool maySkipICMP, inout = false;
index 9283aef1735b1eaa39455a8e64e3e5bfae94db7d..4ca59f9d622718de49aff5869cd77dffa13984b2 100644 (file)
@@ -817,7 +817,7 @@ virBitmapLastSetBit(virBitmapPtr bitmap)
     ssize_t i;
     int unusedBits;
     ssize_t sz;
-    unsigned long bits;
+    unsigned long bits = 0;
 
     unusedBits = bitmap->map_len * VIR_BITMAP_BITS_PER_UNIT - bitmap->max_bit;