From: Peter Krempa <pkrempa(a)redhat.com>
As 'virCPUDefCopy' can't fail any more (without aborting) remove the
last two return value checks.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_domain.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index e45eef4787..c3ca4b3040 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5321,8 +5321,7 @@ qemuDomainDefFormatBufInternal(virQEMUDriver *driver,
*/
if (origCPU) {
virCPUDefFree(def->cpu);
- if (!(def->cpu = virCPUDefCopy(origCPU)))
- return -1;
+ def->cpu = virCPUDefCopy(origCPU);
}
if (def->cpu &&
@@ -9354,8 +9353,8 @@ qemuDomainSaveCookieNew(virDomainObj *vm)
if (!(cookie = virObjectNew(qemuDomainSaveCookieClass)))
return NULL;
- if (priv->origCPU && !(cookie->cpu =
virCPUDefCopy(vm->def->cpu)))
- return NULL;
+ if (priv->origCPU)
+ cookie->cpu = virCPUDefCopy(vm->def->cpu);
cookie->slirpHelper = qemuDomainGetSlirpHelperOk(vm);
--
2.49.0