From 4c94f8d8c170bd857235b53f6a250757d0dcb952 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 20 Sep 2019 12:25:51 +0200 Subject: [PATCH] conf: Drop pointless 'domain' argument from virDomainCheckpointRedefinePrep MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'vm' is passed in which contains the definition which contains the UUID so we don't need another parameter for this. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- src/conf/checkpoint_conf.c | 7 +++---- src/conf/checkpoint_conf.h | 3 +-- src/qemu/qemu_driver.c | 2 +- src/test/test_driver.c | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/conf/checkpoint_conf.c b/src/conf/checkpoint_conf.c index 5c998267aa..a83863adcc 100644 --- a/src/conf/checkpoint_conf.c +++ b/src/conf/checkpoint_conf.c @@ -532,8 +532,7 @@ virDomainCheckpointDefFormat(virDomainCheckpointDefPtr def, int -virDomainCheckpointRedefinePrep(virDomainPtr domain, - virDomainObjPtr vm, +virDomainCheckpointRedefinePrep(virDomainObjPtr vm, virDomainCheckpointDefPtr *defptr, virDomainMomentObjPtr *chk, virDomainXMLOptionPtr xmlopt, @@ -544,13 +543,13 @@ virDomainCheckpointRedefinePrep(virDomainPtr domain, virDomainMomentObjPtr other = NULL; virDomainCheckpointDefPtr otherdef = NULL; - virUUIDFormat(domain->uuid, uuidstr); + virUUIDFormat(vm->def->uuid, uuidstr); if (virDomainCheckpointCheckCycles(vm->checkpoints, def, vm->def->name) < 0) return -1; if (!def->parent.dom || - memcmp(def->parent.dom->uuid, domain->uuid, VIR_UUID_BUFLEN)) { + memcmp(def->parent.dom->uuid, vm->def->uuid, VIR_UUID_BUFLEN)) { virReportError(VIR_ERR_INVALID_ARG, _("definition for checkpoint %s must use uuid %s"), def->parent.name, uuidstr); diff --git a/src/conf/checkpoint_conf.h b/src/conf/checkpoint_conf.h index 47ff69eb4d..2be041ff56 100644 --- a/src/conf/checkpoint_conf.h +++ b/src/conf/checkpoint_conf.h @@ -90,8 +90,7 @@ virDomainCheckpointDefFormat(virDomainCheckpointDefPtr def, int virDomainCheckpointAlignDisks(virDomainCheckpointDefPtr checkpoint); -int virDomainCheckpointRedefinePrep(virDomainPtr domain, - virDomainObjPtr vm, +int virDomainCheckpointRedefinePrep(virDomainObjPtr vm, virDomainCheckpointDefPtr *def, virDomainMomentObjPtr *checkpoint, virDomainXMLOptionPtr xmlopt, diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d7ee713984..09bfda1503 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17291,7 +17291,7 @@ qemuDomainCheckpointCreateXML(virDomainPtr domain, goto cleanup; if (redefine) { - if (virDomainCheckpointRedefinePrep(domain, vm, &def, &chk, + if (virDomainCheckpointRedefinePrep(vm, &def, &chk, driver->xmlopt, &update_current) < 0) goto endjob; diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 9df7840390..dafd8c8daa 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -9073,7 +9073,7 @@ testDomainCheckpointCreateXML(virDomainPtr domain, goto cleanup; if (redefine) { - if (virDomainCheckpointRedefinePrep(domain, vm, &def, &chk, + if (virDomainCheckpointRedefinePrep(vm, &def, &chk, privconn->xmlopt, &update_current) < 0) goto cleanup; -- GitLab