[libvirt] [PATCHv2 0/2] Fix code after the vcpupin series

Both patches are pushed as trivial. Peter Krempa (2): conf: Fix mistakes in pointer usage in virDomainObjGetDefs qemu: Update balloon info only if job is allowed src/conf/domain_conf.c | 4 ++-- src/qemu/qemu_domain.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) -- 2.4.1

Coverity rightfully determined that in commit 3d021381c71221e563182f03 I made a mistake in the first check if @persDef is not NULL is dereferencing it rather than checking. Additionally if the vm is online the code would set @liveDef twice rather than modifying @persDef. Fix both mistakes. --- src/conf/domain_conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 77e198c..36de844 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2927,7 +2927,7 @@ virDomainObjGetDefs(virDomainObjPtr vm, if (liveDef) *liveDef = NULL; - if (*persDef) + if (persDef) *persDef = NULL; if (virDomainObjUpdateModificationImpact(vm, &flags) < 0) @@ -2938,7 +2938,7 @@ virDomainObjGetDefs(virDomainObjPtr vm, *liveDef = vm->def; if (persDef) - *liveDef = vm->newDef; + *persDef = vm->newDef; } else { if (persDef) *persDef = vm->def; -- 2.4.1

In qemuDomainUpdateCurrentMemorySize I misplaced the actual update of the balloon size to a place where it may not be initialized. Move it a few lines above. --- src/qemu/qemu_domain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 3826b2f..0682390 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3256,9 +3256,9 @@ qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver, if (ret < 0) return -1; - } - vm->def->mem.cur_balloon = balloon; + vm->def->mem.cur_balloon = balloon; + } return 0; } -- 2.4.1

On 06/04/2015 08:06 AM, Peter Krempa wrote:
Both patches are pushed as trivial.
Peter Krempa (2): conf: Fix mistakes in pointer usage in virDomainObjGetDefs qemu: Update balloon info only if job is allowed
src/conf/domain_conf.c | 4 ++-- src/qemu/qemu_domain.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
Confirm that the Coverity issues from these changes are resolved John
participants (2)
-
John Ferlan
-
Peter Krempa