tests: Add dirty page rate limit test

Add dirty page rate limit test if kernel support dirty ring,

The following qmp commands are covered by this test case:
"calc-dirty-rate", "query-dirty-rate", "set-vcpu-dirty-limit",
"cancel-vcpu-dirty-limit" and "query-vcpu-dirty-limit".

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Acked-by: Peter Xu <peterx@redhat.com>
Message-Id: <eed5b847a6ef0a9c02a36383dbdd7db367dd1e7e.1656177590.git.huangy81@chinatelecom.cn>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
Hyman Huang(黄勇) 2022-06-26 01:38:37 +08:00 committed by Dr. David Alan Gilbert
parent f3b2e38cfb
commit 8aff6f501d
3 changed files with 280 additions and 0 deletions

View file

@ -83,6 +83,28 @@ QDict *wait_command(QTestState *who, const char *command, ...)
return ret;
}
/*
* Execute the qmp command only
*/
QDict *qmp_command(QTestState *who, const char *command, ...)
{
va_list ap;
QDict *resp, *ret;
va_start(ap, command);
resp = qtest_vqmp(who, command, ap);
va_end(ap);
g_assert(!qdict_haskey(resp, "error"));
g_assert(qdict_haskey(resp, "return"));
ret = qdict_get_qdict(resp, "return");
qobject_ref(ret);
qobject_unref(resp);
return ret;
}
/*
* Send QMP command "migrate".
* Arguments are built from @fmt... (formatted like