mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 20:45:18 +00:00
conf: Move qemuSnapshotDiskGetActualType to virDomainSnapshotDiskGetActualType
All the data for getting the actual type is present in the snapshot config. There is no need to have this function private to the qemu driver and it will be re-used later in other parts of libvirt
This commit is contained in:
parent
f8f020da0a
commit
6fb5a397bf
@ -1291,3 +1291,10 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain,
|
||||
cleanup:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
virDomainSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def)
|
||||
{
|
||||
return def->type;
|
||||
}
|
||||
|
@ -187,6 +187,8 @@ int virDomainSnapshotRedefinePrep(virDomainPtr domain,
|
||||
bool *update_current,
|
||||
unsigned int flags);
|
||||
|
||||
int virDomainSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def);
|
||||
|
||||
VIR_ENUM_DECL(virDomainSnapshotLocation)
|
||||
VIR_ENUM_DECL(virDomainSnapshotState)
|
||||
|
||||
|
@ -659,6 +659,7 @@ virDomainSnapshotDefFormat;
|
||||
virDomainSnapshotDefFree;
|
||||
virDomainSnapshotDefIsExternal;
|
||||
virDomainSnapshotDefParseString;
|
||||
virDomainSnapshotDiskGetActualType;
|
||||
virDomainSnapshotDropParent;
|
||||
virDomainSnapshotFindByName;
|
||||
virDomainSnapshotForEach;
|
||||
|
@ -1464,13 +1464,6 @@ cleanup:
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
qemuSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def)
|
||||
{
|
||||
return def->type;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
qemuTranslateSnapshotDiskSourcePool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
virDomainSnapshotDiskDefPtr def)
|
||||
|
@ -308,8 +308,6 @@ virDomainXMLOptionPtr virQEMUDriverCreateXMLConf(virQEMUDriverPtr driver);
|
||||
int qemuTranslateDiskSourcePool(virConnectPtr conn,
|
||||
virDomainDiskDefPtr def);
|
||||
|
||||
int qemuSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def);
|
||||
|
||||
int qemuTranslateSnapshotDiskSourcePool(virConnectPtr conn,
|
||||
virDomainSnapshotDiskDefPtr def);
|
||||
|
||||
|
@ -12321,7 +12321,7 @@ qemuDomainSnapshotPrepareDiskExternalBackingActive(virDomainDiskDefPtr disk)
|
||||
static int
|
||||
qemuDomainSnapshotPrepareDiskExternalOverlayActive(virDomainSnapshotDiskDefPtr disk)
|
||||
{
|
||||
int actualType = qemuSnapshotDiskGetActualType(disk);
|
||||
int actualType = virDomainSnapshotDiskGetActualType(disk);
|
||||
|
||||
switch ((enum virDomainDiskType) actualType) {
|
||||
case VIR_DOMAIN_DISK_TYPE_BLOCK:
|
||||
@ -12345,7 +12345,7 @@ qemuDomainSnapshotPrepareDiskExternalOverlayActive(virDomainSnapshotDiskDefPtr d
|
||||
static int
|
||||
qemuDomainSnapshotPrepareDiskExternalOverlayInactive(virDomainSnapshotDiskDefPtr disk)
|
||||
{
|
||||
int actualType = qemuSnapshotDiskGetActualType(disk);
|
||||
int actualType = virDomainSnapshotDiskGetActualType(disk);
|
||||
|
||||
switch ((enum virDomainDiskType) actualType) {
|
||||
case VIR_DOMAIN_DISK_TYPE_BLOCK:
|
||||
@ -12397,7 +12397,7 @@ qemuDomainSnapshotPrepareDiskExternal(virConnectPtr conn,
|
||||
return -1;
|
||||
}
|
||||
|
||||
actualType = qemuSnapshotDiskGetActualType(snapdisk);
|
||||
actualType = virDomainSnapshotDiskGetActualType(snapdisk);
|
||||
|
||||
switch ((enum virDomainDiskType) actualType) {
|
||||
case VIR_DOMAIN_DISK_TYPE_BLOCK:
|
||||
|
Loading…
x
Reference in New Issue
Block a user