mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
include: Introduce virDomainDirtyRateCalcFlags
Introduce virDomainDirtyRateCalcFlags to get ready for adding mode parameter to qemuDomainStartDirtyRateCalc. Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
f8dc72f0ca
commit
e7a8bd2173
@ -5259,6 +5259,19 @@ typedef enum {
|
||||
# endif
|
||||
} virDomainDirtyRateStatus;
|
||||
|
||||
/**
|
||||
* virDomainDirtyRateCalcFlags:
|
||||
*
|
||||
* Flags OR'ed together to provide specific behaviour when calculating dirty page
|
||||
* rate for a Domain
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
VIR_DOMAIN_DIRTYRATE_MODE_PAGE_SAMPLING = 0, /* default mode - page-sampling */
|
||||
VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_BITMAP = 1 << 0, /* dirty-bitmap mode */
|
||||
VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_RING = 1 << 1, /* dirty-ring mode */
|
||||
} virDomainDirtyRateCalcFlags;
|
||||
|
||||
int virDomainStartDirtyRateCalc(virDomainPtr domain,
|
||||
int seconds,
|
||||
unsigned int flags);
|
||||
|
@ -13337,7 +13337,7 @@ virDomainGetMessages(virDomainPtr domain,
|
||||
* virDomainStartDirtyRateCalc:
|
||||
* @domain: a domain object
|
||||
* @seconds: specified calculating time in seconds
|
||||
* @flags: extra flags; not used yet, so callers should always pass 0
|
||||
* @flags: bitwise-OR of supported virDomainDirtyRateCalcFlags
|
||||
*
|
||||
* Calculate the current domain's memory dirty rate in next @seconds.
|
||||
* The calculated dirty rate information is available by calling
|
||||
@ -13361,6 +13361,16 @@ virDomainStartDirtyRateCalc(virDomainPtr domain,
|
||||
|
||||
virCheckReadOnlyGoto(conn->flags, error);
|
||||
|
||||
VIR_EXCLUSIVE_FLAGS_GOTO(VIR_DOMAIN_DIRTYRATE_MODE_PAGE_SAMPLING,
|
||||
VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_BITMAP,
|
||||
error);
|
||||
VIR_EXCLUSIVE_FLAGS_GOTO(VIR_DOMAIN_DIRTYRATE_MODE_PAGE_SAMPLING,
|
||||
VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_RING,
|
||||
error);
|
||||
VIR_EXCLUSIVE_FLAGS_GOTO(VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_BITMAP,
|
||||
VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_RING,
|
||||
error);
|
||||
|
||||
if (conn->driver->domainStartDirtyRateCalc) {
|
||||
int ret;
|
||||
ret = conn->driver->domainStartDirtyRateCalc(domain, seconds, flags);
|
||||
|
Loading…
x
Reference in New Issue
Block a user