snapshot: qemu: Separate logic blocks with newlines

This commit is contained in:
Peter Krempa 2013-01-03 14:13:05 +01:00
parent 51b12b8cca
commit 4494b11f8f

View File

@ -11365,6 +11365,7 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
goto cleanup; goto cleanup;
} }
if (def->dom && if (def->dom &&
memcmp(def->dom->uuid, domain->uuid, VIR_UUID_BUFLEN)) { memcmp(def->dom->uuid, domain->uuid, VIR_UUID_BUFLEN)) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
@ -11372,6 +11373,7 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
def->name, uuidstr); def->name, uuidstr);
goto cleanup; goto cleanup;
} }
other = virDomainSnapshotFindByName(vm->snapshots, def->name); other = virDomainSnapshotFindByName(vm->snapshots, def->name);
if (other) { if (other) {
if ((other->def->state == VIR_DOMAIN_RUNNING || if ((other->def->state == VIR_DOMAIN_RUNNING ||
@ -11384,6 +11386,7 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
def->name); def->name);
goto cleanup; goto cleanup;
} }
if ((other->def->state == VIR_DOMAIN_DISK_SNAPSHOT) != if ((other->def->state == VIR_DOMAIN_DISK_SNAPSHOT) !=
(def->state == VIR_DOMAIN_DISK_SNAPSHOT)) { (def->state == VIR_DOMAIN_DISK_SNAPSHOT)) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
@ -11392,6 +11395,7 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
def->name); def->name);
goto cleanup; goto cleanup;
} }
if (other->def->dom) { if (other->def->dom) {
if (def->dom) { if (def->dom) {
if (!virDomainDefCheckABIStability(other->def->dom, if (!virDomainDefCheckABIStability(other->def->dom,
@ -11403,10 +11407,12 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
other->def->dom = NULL; other->def->dom = NULL;
} }
} }
if (other == vm->current_snapshot) { if (other == vm->current_snapshot) {
update_current = true; update_current = true;
vm->current_snapshot = NULL; vm->current_snapshot = NULL;
} }
/* Drop and rebuild the parent relationship, but keep all /* Drop and rebuild the parent relationship, but keep all
* child relations by reusing snap. */ * child relations by reusing snap. */
virDomainSnapshotDropParent(other); virDomainSnapshotDropParent(other);