diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index f061bb743f..c1b46f7d0a 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -194,11 +194,11 @@ qemuBlockJobEventProcess(virQEMUDriverPtr driver, if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) VIR_WARN("Unable to save status on vm %s after block job", vm->def->name); - if (persistDisk && virDomainSaveConfig(cfg->configDir, - driver->caps, - vm->newDef) < 0) - VIR_WARN("Unable to update persistent definition on vm %s " - "after block job", vm->def->name); + if (status == VIR_DOMAIN_BLOCK_JOB_COMPLETED && vm->newDef) { + if (virDomainSaveConfig(cfg->configDir, driver->caps, vm->newDef) < 0) + VIR_WARN("Unable to update persistent definition on vm %s " + "after block job", vm->def->name); + } qemuDomainEventQueue(driver, event); qemuDomainEventQueue(driver, event2);