提交 6fb5a397 编写于 作者: P Peter Krempa

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
上级 f8f020da
...@@ -1291,3 +1291,10 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain, ...@@ -1291,3 +1291,10 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain,
cleanup: cleanup:
return ret; return ret;
} }
int
virDomainSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def)
{
return def->type;
}
...@@ -187,6 +187,8 @@ int virDomainSnapshotRedefinePrep(virDomainPtr domain, ...@@ -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)
......
...@@ -659,6 +659,7 @@ virDomainSnapshotDefFormat; ...@@ -659,6 +659,7 @@ virDomainSnapshotDefFormat;
virDomainSnapshotDefFree; virDomainSnapshotDefFree;
virDomainSnapshotDefIsExternal; virDomainSnapshotDefIsExternal;
virDomainSnapshotDefParseString; virDomainSnapshotDefParseString;
virDomainSnapshotDiskGetActualType;
virDomainSnapshotDropParent; virDomainSnapshotDropParent;
virDomainSnapshotFindByName; virDomainSnapshotFindByName;
virDomainSnapshotForEach; virDomainSnapshotForEach;
......
...@@ -1464,13 +1464,6 @@ cleanup: ...@@ -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)
......
...@@ -308,8 +308,6 @@ virDomainXMLOptionPtr virQEMUDriverCreateXMLConf(virQEMUDriverPtr driver); ...@@ -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);
......
...@@ -12321,7 +12321,7 @@ qemuDomainSnapshotPrepareDiskExternalBackingActive(virDomainDiskDefPtr disk) ...@@ -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 ...@@ -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, ...@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册