mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: snapshot: Detect internal snapshots also for sheepdog and RBD
When doing an internal snapshot on a VM with sheepdog or RBD disks we would not set a flag to mark the domain is using internal snapshots and might end up creating a mixed snapshot. Move the setting of the variable to avoid this problem.
This commit is contained in:
parent
ae361674ac
commit
d8cf91ae38
@ -11766,6 +11766,8 @@ qemuDomainSnapshotPrepare(virDomainObjPtr vm, virDomainSnapshotDefPtr def,
|
|||||||
|
|
||||||
switch (disk->snapshot) {
|
switch (disk->snapshot) {
|
||||||
case VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL:
|
case VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL:
|
||||||
|
found_internal = true;
|
||||||
|
|
||||||
if (def->state != VIR_DOMAIN_DISK_SNAPSHOT &&
|
if (def->state != VIR_DOMAIN_DISK_SNAPSHOT &&
|
||||||
dom_disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK &&
|
dom_disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK &&
|
||||||
(dom_disk->protocol == VIR_DOMAIN_DISK_PROTOCOL_SHEEPDOG ||
|
(dom_disk->protocol == VIR_DOMAIN_DISK_PROTOCOL_SHEEPDOG ||
|
||||||
@ -11789,7 +11791,6 @@ qemuDomainSnapshotPrepare(virDomainObjPtr vm, virDomainSnapshotDefPtr def,
|
|||||||
disk->name);
|
disk->name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
found_internal = true;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL:
|
case VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL:
|
||||||
|
Loading…
Reference in New Issue
Block a user