提交 7e6242e9 编写于 作者: P Peter Krempa

qemu: snapshot: Add functions similar to disk source pool translation

To avoid future pain, add placeholder functions to get the actual
snapshot disk type.
上级 cdf02d64
......@@ -1402,3 +1402,26 @@ cleanup:
virStoragePoolDefFree(pooldef);
return ret;
}
int
qemuSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def)
{
if (def->type == -1)
return VIR_DOMAIN_DISK_TYPE_FILE;
return def->type;
}
int
qemuTranslateSnapshotDiskSourcePool(virConnectPtr conn ATTRIBUTE_UNUSED,
virDomainSnapshotDiskDefPtr def)
{
if (def->type != VIR_DOMAIN_DISK_TYPE_VOLUME)
return 0;
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Snapshots are not yet supported with 'pool' volumes"));
return -1;
}
......@@ -29,6 +29,7 @@
# include "capabilities.h"
# include "network_conf.h"
# include "domain_conf.h"
# include "snapshot_conf.h"
# include "domain_event.h"
# include "virthread.h"
# include "security/security_manager.h"
......@@ -307,4 +308,9 @@ virDomainXMLOptionPtr virQEMUDriverCreateXMLConf(virQEMUDriverPtr driver);
int qemuTranslateDiskSourcePool(virConnectPtr conn,
virDomainDiskDefPtr def);
int qemuSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def);
int qemuTranslateSnapshotDiskSourcePool(virConnectPtr conn,
virDomainSnapshotDiskDefPtr def);
#endif /* __QEMUD_CONF_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册