mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
test: add poll-weight support to the test driver
Add poll-weight support to the test driver so that the virsh test suite can exercise the iothreadset --poll-weight path end-to-end. Add a poll_weight field to the testIOThreadInfo struct and initialise it to 0 in both testDomainGenerateIOThreadInfos and testDomainAddIOThread. Extend testDomainIOThreadParseParams to accept and store VIR_DOMAIN_IOTHREAD_POLL_WEIGHT, and extend testDomainGetStatsIOThread to emit the value via domstats. Update the expected iothreads.out output to include the poll-weight=0 field in the existing domstats blocks now that the test driver reports it unconditionally. Signed-off-by: Jaehoon Kim <jhkim@linux.ibm.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
1 parent
af0d03b215
commit
3412e9c739
2 files changed
+16
No files matched your search
@@ -189,6 +189,7 @@ struct _testIOThreadInfo {
|
||||
unsigned long long poll_max_ns;
|
||||
unsigned int poll_grow;
|
||||
unsigned int poll_shrink;
|
||||
unsigned int poll_weight;
|
||||
};
|
||||
|
||||
static void
|
||||
@@ -749,6 +750,7 @@ testDomainGenerateIOThreadInfos(virDomainObj *obj)
|
||||
iothread.poll_max_ns = 32768;
|
||||
iothread.poll_grow = 0;
|
||||
iothread.poll_shrink = 0;
|
||||
iothread.poll_weight = 0;
|
||||
g_array_append_val(priv->iothreads, iothread);
|
||||
}
|
||||
}
|
||||
@@ -9681,6 +9683,7 @@ testDomainAddIOThread(virDomainPtr dom,
|
||||
iothread.poll_max_ns = 32768;
|
||||
iothread.poll_grow = 0;
|
||||
iothread.poll_shrink = 0;
|
||||
iothread.poll_weight = 0;
|
||||
|
||||
g_array_append_val(priv->iothreads, iothread);
|
||||
|
||||
@@ -9795,6 +9798,8 @@ testDomainIOThreadParseParams(virTypedParameterPtr params,
|
||||
VIR_TYPED_PARAM_UINT,
|
||||
VIR_DOMAIN_IOTHREAD_POLL_SHRINK,
|
||||
VIR_TYPED_PARAM_UINT,
|
||||
VIR_DOMAIN_IOTHREAD_POLL_WEIGHT,
|
||||
VIR_TYPED_PARAM_UINT,
|
||||
NULL) < 0)
|
||||
return -1;
|
||||
|
||||
@@ -9813,6 +9818,11 @@ testDomainIOThreadParseParams(virTypedParameterPtr params,
|
||||
&iothread->poll_shrink) < 0)
|
||||
return -1;
|
||||
|
||||
if (virTypedParamsGetUInt(params, nparams,
|
||||
VIR_DOMAIN_IOTHREAD_POLL_WEIGHT,
|
||||
&iothread->poll_weight) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -9899,6 +9909,8 @@ testDomainGetStatsIOThread(virDomainObj *dom,
|
||||
"iothread.%u.poll-grow", iothread.iothread_id);
|
||||
virTypedParamListAddUInt(params, iothread.poll_shrink,
|
||||
"iothread.%u.poll-shrink", iothread.iothread_id);
|
||||
virTypedParamListAddUInt(params, iothread.poll_weight,
|
||||
"iothread.%u.poll-weight", iothread.iothread_id);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -23,9 +23,11 @@ Domain: 'fc4'
|
||||
iothread.4.poll-max-ns=32768
|
||||
iothread.4.poll-grow=0
|
||||
iothread.4.poll-shrink=0
|
||||
iothread.4.poll-weight=0
|
||||
iothread.6.poll-max-ns=32768
|
||||
iothread.6.poll-grow=0
|
||||
iothread.6.poll-shrink=0
|
||||
iothread.6.poll-weight=0
|
||||
|
||||
|
||||
Domain: 'fc4'
|
||||
@@ -35,9 +37,11 @@ Domain: 'fc4'
|
||||
iothread.4.poll-max-ns=32768
|
||||
iothread.4.poll-grow=0
|
||||
iothread.4.poll-shrink=0
|
||||
iothread.4.poll-weight=0
|
||||
iothread.6.poll-max-ns=100
|
||||
iothread.6.poll-grow=10
|
||||
iothread.6.poll-shrink=10
|
||||
iothread.6.poll-weight=0
|
||||
|
||||
|
||||
IOThread ID CPU Affinity
|
||||
|
||||
Reference in new issue
Block a user