mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
qemuagenttest: Test the filesystem trimming
This commit is contained in:
parent
5c94dfdd76
commit
725ee3b1d5
@ -131,6 +131,36 @@ cleanup:
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
testQemuAgentFSTrim(const void *data)
|
||||
{
|
||||
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
|
||||
qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt);
|
||||
int ret = -1;
|
||||
|
||||
if (!test)
|
||||
return -1;
|
||||
|
||||
if (qemuMonitorTestAddAgentSyncResponse(test) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (qemuMonitorTestAddItemParams(test, "guest-fstrim",
|
||||
"{ \"return\" : {} }",
|
||||
"minimum", "1337",
|
||||
NULL) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (qemuAgentFSTrim(qemuMonitorTestGetAgent(test), 1337) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
qemuMonitorTestFree(test);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
mymain(void)
|
||||
{
|
||||
@ -154,6 +184,7 @@ mymain(void)
|
||||
|
||||
DO_TEST(FSFreeze);
|
||||
DO_TEST(FSThaw);
|
||||
DO_TEST(FSTrim);
|
||||
|
||||
virObjectUnref(xmlopt);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user