mirror of https://gitee.com/openkylin/libvirt.git
qemu: silence clang false positive
Our logic throws off analyzer tools: ptr var = NULL; if (flags == 0) flags = live ? _LIVE : _CONFIG; if (flags & _LIVE) do stuff if (flags & _CONFIG) var = non-null; if (flags & _LIVE) do more stuff else if (flags & _CONFIG) use var the tools keep thinking that var can still be NULL in the last if clause, adding the hint shuts them up. * src/qemu/qemu_driver.c (qemuDomainSetBlkioParameters): Add a static analysis hint.
This commit is contained in:
parent
4a6ffae3b6
commit
398ce48d5c
|
@ -5688,6 +5688,9 @@ static int qemuDomainSetBlkioParameters(virDomainPtr dom,
|
|||
}
|
||||
}
|
||||
} else if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
||||
/* Clang can't see that if we get here, persistentDef was set. */
|
||||
sa_assert(persistentDef);
|
||||
|
||||
for (i = 0; i < nparams; i++) {
|
||||
virTypedParameterPtr param = ¶ms[i];
|
||||
|
||||
|
|
Loading…
Reference in New Issue