[PATCH] virDomainFormatSchedDef: Initialize @priority

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Older gcc fails to see that the variable is set iff @hasPriority
== true in which case the former is set a value. Initialize the
value while declaring it to make the compiler shut up.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---

This maybe isn't the best approach, to workaround false
positives. I'm open to discussion.

 src/conf/domain_conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 895a51b..67415fa 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -21472,7 +21472,7 @@ virDomainFormatSchedDef(virDomainDefPtr def,
             virBitmapPtr currentMap = NULL;
             ssize_t nextprio;
             bool hasPriority = false;
-            int priority;
+            int priority = 0;
 
             switch ((virProcessSchedPolicy) i) {
             case VIR_PROC_POLICY_NONE:
-- 
2.4.10

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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]