mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
qemu: silence clang false positives
Clang 2.8 wasn't quite able to follow that persistentDef was assigned earlier if (flags & VIR_DOMAIN_MEM_CONFIG) is true. Silence this false positive, to make clang analysis easier to use. * src/qemu/qemu_driver.c (qemudDomainSetMemoryFlags): Add an annotation to silence clang's claim of a NULL dereference.
This commit is contained in:
parent
44699b3283
commit
d8f7528157
@ -1640,6 +1640,8 @@ static int qemudDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
|
||||
}
|
||||
|
||||
if (flags & VIR_DOMAIN_MEM_CONFIG) {
|
||||
/* Help clang 2.8 decipher the logic flow. */
|
||||
sa_assert(persistentDef);
|
||||
persistentDef->mem.max_balloon = newmem;
|
||||
if (persistentDef->mem.cur_balloon > newmem)
|
||||
persistentDef->mem.cur_balloon = newmem;
|
||||
@ -1675,6 +1677,7 @@ static int qemudDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
|
||||
}
|
||||
|
||||
if (flags & VIR_DOMAIN_MEM_CONFIG) {
|
||||
sa_assert(persistentDef);
|
||||
persistentDef->mem.cur_balloon = newmem;
|
||||
ret = virDomainSaveConfig(driver->configDir, persistentDef);
|
||||
goto endjob;
|
||||
|
Loading…
x
Reference in New Issue
Block a user