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:
Peter Krempa 2014-02-13 10:41:01 +01:00
parent f8f020da0a
commit 6fb5a397bf
6 changed files with 13 additions and 12 deletions

View File

@ -1291,3 +1291,10 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain,
cleanup:
return ret;
}
int
virDomainSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def)
{
return def->type;
}

View File

@ -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)

View File

@ -659,6 +659,7 @@ virDomainSnapshotDefFormat;
virDomainSnapshotDefFree;
virDomainSnapshotDefIsExternal;
virDomainSnapshotDefParseString;
virDomainSnapshotDiskGetActualType;
virDomainSnapshotDropParent;
virDomainSnapshotFindByName;
virDomainSnapshotForEach;

View File

@ -1464,13 +1464,6 @@ cleanup:
}
int
qemuSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def)
{
return def->type;
}
int
qemuTranslateSnapshotDiskSourcePool(virConnectPtr conn ATTRIBUTE_UNUSED,
virDomainSnapshotDiskDefPtr def)

View File

@ -308,8 +308,6 @@ virDomainXMLOptionPtr virQEMUDriverCreateXMLConf(virQEMUDriverPtr driver);
int qemuTranslateDiskSourcePool(virConnectPtr conn,
virDomainDiskDefPtr def);
int qemuSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def);
int qemuTranslateSnapshotDiskSourcePool(virConnectPtr conn,
virDomainSnapshotDiskDefPtr def);

View File

@ -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: