[[RESEND] 1/8] migration/dirtyrate: Introduce virDomainDirtyRateInfo structure

Hao Wang posted 1 patch 1 week ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20201015074946.2740968-2-wanghao232@huawei.com
include/libvirt/libvirt-domain.h | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

[[RESEND] 1/8] migration/dirtyrate: Introduce virDomainDirtyRateInfo structure

Posted by Hao Wang 1 week ago
Introduce virDomainDirtyRateInfo structure used for domain's memory dirty rate query.

Signed-off-by: Hao Wang <wanghao232@huawei.com>
Reviewed-by: Chuan Zheng <zhengchuan@huawei.com>
---
 include/libvirt/libvirt-domain.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index 77f9116675..c7e22d4af1 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -5012,4 +5012,28 @@ int virDomainBackupBegin(virDomainPtr domain,
 char *virDomainBackupGetXMLDesc(virDomainPtr domain,
                                 unsigned int flags);
 
+/**
+ * virDomainDirtyRateInfo:
+ *
+ * a virDomainDirtyRateInfo is a structure filled by virDomainGetDirtyRate() and
+ * extracting dirty rate infomation for a given active Domain.
+ */
+
+typedef struct _virDomainDirtyRateInfo virDomainDirtyRateInfo;
+
+struct _virDomainDirtyRateInfo {
+    int status;             /* the status of dirtyrate calculation */
+    long long dirtyRate;    /* the dirtyrate in MB/s */
+    long long startTime;    /* the start time of dirtyrate calculation */
+    long long calcTime;     /* the period of dirtyrate calculation */
+};
+
+/**
+ * virDomainDirtyRateInfoPtr:
+ *
+ * a virDomainDirtyRateInfoPtr is a pointer to a virDomainDirtyRateInfo structure.
+ */
+
+typedef virDomainDirtyRateInfo *virDomainDirtyRateInfoPtr;
+
 #endif /* LIBVIRT_DOMAIN_H */
-- 
2.23.0