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: cleanup:
return ret; return ret;
} }
int
virDomainSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def)
{
return def->type;
}

View File

@ -187,6 +187,8 @@ int virDomainSnapshotRedefinePrep(virDomainPtr domain,
bool *update_current, bool *update_current,
unsigned int flags); unsigned int flags);
int virDomainSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def);
VIR_ENUM_DECL(virDomainSnapshotLocation) VIR_ENUM_DECL(virDomainSnapshotLocation)
VIR_ENUM_DECL(virDomainSnapshotState) VIR_ENUM_DECL(virDomainSnapshotState)

View File

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

View File

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

View File

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

View File

@ -12321,7 +12321,7 @@ qemuDomainSnapshotPrepareDiskExternalBackingActive(virDomainDiskDefPtr disk)
static int static int
qemuDomainSnapshotPrepareDiskExternalOverlayActive(virDomainSnapshotDiskDefPtr disk) qemuDomainSnapshotPrepareDiskExternalOverlayActive(virDomainSnapshotDiskDefPtr disk)
{ {
int actualType = qemuSnapshotDiskGetActualType(disk); int actualType = virDomainSnapshotDiskGetActualType(disk);
switch ((enum virDomainDiskType) actualType) { switch ((enum virDomainDiskType) actualType) {
case VIR_DOMAIN_DISK_TYPE_BLOCK: case VIR_DOMAIN_DISK_TYPE_BLOCK:
@ -12345,7 +12345,7 @@ qemuDomainSnapshotPrepareDiskExternalOverlayActive(virDomainSnapshotDiskDefPtr d
static int static int
qemuDomainSnapshotPrepareDiskExternalOverlayInactive(virDomainSnapshotDiskDefPtr disk) qemuDomainSnapshotPrepareDiskExternalOverlayInactive(virDomainSnapshotDiskDefPtr disk)
{ {
int actualType = qemuSnapshotDiskGetActualType(disk); int actualType = virDomainSnapshotDiskGetActualType(disk);
switch ((enum virDomainDiskType) actualType) { switch ((enum virDomainDiskType) actualType) {
case VIR_DOMAIN_DISK_TYPE_BLOCK: case VIR_DOMAIN_DISK_TYPE_BLOCK:
@ -12397,7 +12397,7 @@ qemuDomainSnapshotPrepareDiskExternal(virConnectPtr conn,
return -1; return -1;
} }
actualType = qemuSnapshotDiskGetActualType(snapdisk); actualType = virDomainSnapshotDiskGetActualType(snapdisk);
switch ((enum virDomainDiskType) actualType) { switch ((enum virDomainDiskType) actualType) {
case VIR_DOMAIN_DISK_TYPE_BLOCK: case VIR_DOMAIN_DISK_TYPE_BLOCK: