提交 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,
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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册