[libvirt] [PATCH] Fix the recent CI build failures

Ján Tomko jtomko at redhat.com
Tue Mar 5 12:11:19 UTC 2019


Please describe the change being made in the commit summary, e.g:
conf: initialize variables in virDomainThreadSchedParseHelper

The 'why?' fits better in the body of the commit message.

Jano

On Tue, Mar 05, 2019 at 10:09:23AM +0100, Erik Skultety wrote:
>After commits e2087c2 and ec0793de older GCC started act very smart and
>complain about potentially uninitialized variable, which existed prior
>to these patches + even if the affected vars were left uninitialized the
>function responsible for filling them in would have failed with NULL
>being returned which the caller has always handled carefully.
>Although GCC complained only about a single variable, let's initialize
>all of them so as to prevent any further potential breakages.
>
>Signed-off-by: Erik Skultety <eskultet at redhat.com>
>---
>
>Pushed under the build breaker rule.
>
> src/conf/domain_conf.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
>diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
>index bfafac407e..d84cc2d482 100644
>--- a/src/conf/domain_conf.c
>+++ b/src/conf/domain_conf.c
>@@ -18400,9 +18400,9 @@ virDomainThreadSchedParseHelper(xmlNodePtr node,
>                                 virDomainDefPtr def)
> {
>     ssize_t next = -1;
>-    virDomainThreadSchedParamPtr sched;
>-    virProcessSchedPolicy policy;
>-    int priority;
>+    virDomainThreadSchedParamPtr sched = NULL;
>+    virProcessSchedPolicy policy = 0;
>+    int priority = 0;
>     VIR_AUTOPTR(virBitmap) map = NULL;
>
>     if (!(map = virDomainSchedulerParse(node, name, &policy, &priority)))
>--
>2.20.1
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190305/e114ce7f/attachment-0001.sig>


More information about the libvir-list mailing list