virDomainCheckpointRedefineCommit: Don't check ABI of definition in checkpoint

Checking the definition ABI when redefining checkpoints doesn't make
much sense for the following reasons:

* the domain definition in the checkpoint is mostly unused (a relic
  adopted from the snapshot code)

* can be very easily overridden by deleting the checkpoint metadata
  before redefinition

Rather than complicating the logic when we'll be taking into account
that the domain definition may be missing, let's just remove the check.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
Peter Krempa 2020-12-02 13:35:29 +01:00
parent 9a58f1a53c
commit 9fd8ba3b2d
4 changed files with 6 additions and 13 deletions

View File

@ -530,8 +530,7 @@ virDomainCheckpointRedefinePrep(virDomainObjPtr vm,
virDomainMomentObjPtr virDomainMomentObjPtr
virDomainCheckpointRedefineCommit(virDomainObjPtr vm, virDomainCheckpointRedefineCommit(virDomainObjPtr vm,
virDomainCheckpointDefPtr *defptr, virDomainCheckpointDefPtr *defptr)
virDomainXMLOptionPtr xmlopt)
{ {
virDomainCheckpointDefPtr def = *defptr; virDomainCheckpointDefPtr def = *defptr;
virDomainMomentObjPtr other = NULL; virDomainMomentObjPtr other = NULL;
@ -541,10 +540,6 @@ virDomainCheckpointRedefineCommit(virDomainObjPtr vm,
other = virDomainCheckpointFindByName(vm->checkpoints, def->parent.name); other = virDomainCheckpointFindByName(vm->checkpoints, def->parent.name);
if (other) { if (other) {
otherdef = virDomainCheckpointObjGetDef(other); otherdef = virDomainCheckpointObjGetDef(other);
if (!virDomainDefCheckABIStability(otherdef->parent.dom,
def->parent.dom, xmlopt))
return NULL;
/* Drop and rebuild the parent relationship, but keep all /* Drop and rebuild the parent relationship, but keep all
* child relations by reusing chk. */ * child relations by reusing chk. */
virDomainMomentDropParent(other); virDomainMomentDropParent(other);

View File

@ -96,7 +96,6 @@ virDomainCheckpointRedefinePrep(virDomainObjPtr vm,
virDomainMomentObjPtr virDomainMomentObjPtr
virDomainCheckpointRedefineCommit(virDomainObjPtr vm, virDomainCheckpointRedefineCommit(virDomainObjPtr vm,
virDomainCheckpointDefPtr *defptr, virDomainCheckpointDefPtr *defptr);
virDomainXMLOptionPtr xmlopt);
VIR_ENUM_DECL(virDomainCheckpoint); VIR_ENUM_DECL(virDomainCheckpoint);

View File

@ -439,8 +439,7 @@ qemuCheckpointRedefineValidateBitmaps(virDomainObjPtr vm,
static virDomainMomentObjPtr static virDomainMomentObjPtr
qemuCheckpointRedefine(virQEMUDriverPtr driver, qemuCheckpointRedefine(virDomainObjPtr vm,
virDomainObjPtr vm,
virDomainCheckpointDefPtr *def, virDomainCheckpointDefPtr *def,
bool *update_current, bool *update_current,
bool validate_bitmaps) bool validate_bitmaps)
@ -452,7 +451,7 @@ qemuCheckpointRedefine(virQEMUDriverPtr driver,
qemuCheckpointRedefineValidateBitmaps(vm, *def) < 0) qemuCheckpointRedefineValidateBitmaps(vm, *def) < 0)
return NULL; return NULL;
return virDomainCheckpointRedefineCommit(vm, def, driver->xmlopt); return virDomainCheckpointRedefineCommit(vm, def);
} }
@ -605,7 +604,7 @@ qemuCheckpointCreateXML(virDomainPtr domain,
return NULL; return NULL;
if (redefine) { if (redefine) {
chk = qemuCheckpointRedefine(driver, vm, &def, &update_current, validate_bitmaps); chk = qemuCheckpointRedefine(vm, &def, &update_current, validate_bitmaps);
} else { } else {
chk = qemuCheckpointCreate(driver, vm, &def); chk = qemuCheckpointCreate(driver, vm, &def);
} }

View File

@ -8991,7 +8991,7 @@ testDomainCheckpointCreateXML(virDomainPtr domain,
if (virDomainCheckpointRedefinePrep(vm, def, &update_current) < 0) if (virDomainCheckpointRedefinePrep(vm, def, &update_current) < 0)
goto cleanup; goto cleanup;
if (!(chk = virDomainCheckpointRedefineCommit(vm, &def, privconn->xmlopt))) if (!(chk = virDomainCheckpointRedefineCommit(vm, &def)))
goto cleanup; goto cleanup;
} else { } else {
if (!(def->parent.dom = virDomainDefCopy(vm->def, if (!(def->parent.dom = virDomainDefCopy(vm->def,