'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 <pkrempa@xxxxxxxxxx> --- src/conf/snapshot_conf.c | 5 ++--- src/conf/snapshot_conf.h | 3 +-- src/qemu/qemu_driver.c | 2 +- src/test/test_driver.c | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index 61c807a71f..96ad8ca953 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -986,8 +986,7 @@ virDomainSnapshotIsExternal(virDomainMomentObjPtr snap) } int -virDomainSnapshotRedefinePrep(virDomainPtr domain, - virDomainObjPtr vm, +virDomainSnapshotRedefinePrep(virDomainObjPtr vm, virDomainSnapshotDefPtr *defptr, virDomainMomentObjPtr *snap, virDomainXMLOptionPtr xmlopt, @@ -1006,7 +1005,7 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain, if (other) otherdef = virDomainSnapshotObjGetDef(other); check_if_stolen = other && otherdef->parent.dom; - if (virDomainSnapshotRedefineValidate(def, domain->uuid, other, xmlopt, + if (virDomainSnapshotRedefineValidate(def, vm->def->uuid, other, xmlopt, flags) < 0) { /* revert any stealing of the snapshot domain definition */ if (check_if_stolen && def->parent.dom && !otherdef->parent.dom) diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h index 216726fc16..17d614a7e1 100644 --- a/src/conf/snapshot_conf.h +++ b/src/conf/snapshot_conf.h @@ -129,8 +129,7 @@ int virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr snapshot, bool virDomainSnapshotDefIsExternal(virDomainSnapshotDefPtr def); bool virDomainSnapshotIsExternal(virDomainMomentObjPtr snap); -int virDomainSnapshotRedefinePrep(virDomainPtr domain, - virDomainObjPtr vm, +int virDomainSnapshotRedefinePrep(virDomainObjPtr vm, virDomainSnapshotDefPtr *def, virDomainMomentObjPtr *snap, virDomainXMLOptionPtr xmlopt, diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index e16069b65e..ca25814bd1 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -15979,7 +15979,7 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, qemuDomainObjSetAsyncJobMask(vm, QEMU_JOB_NONE); if (redefine) { - if (virDomainSnapshotRedefinePrep(domain, vm, &def, &snap, + if (virDomainSnapshotRedefinePrep(vm, &def, &snap, driver->xmlopt, &update_current, flags) < 0) goto endjob; diff --git a/src/test/test_driver.c b/src/test/test_driver.c index dafd8c8daa..19b8158ed6 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -8612,7 +8612,7 @@ testDomainSnapshotCreateXML(virDomainPtr domain, goto cleanup; if (redefine) { - if (virDomainSnapshotRedefinePrep(domain, vm, &def, &snap, + if (virDomainSnapshotRedefinePrep(vm, &def, &snap, privconn->xmlopt, &update_current, flags) < 0) goto cleanup; -- 2.21.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list