mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 21:15:20 +00:00
qemu: snapshot: Add functions similar to disk source pool translation
To avoid future pain, add placeholder functions to get the actual snapshot disk type.
This commit is contained in:
parent
cdf02d6474
commit
7e6242e9a7
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user