#else
-# define EQUAL "="
-
static void testFilterLine(char *buffer,
const char *toRemove)
{
"--connect", \
custom_uri
-static int testIOThreadAdd(const void *data)
-{
- const char *const argv[] = { VIRSH_CUSTOM, "iothreadinfo --domain fc4;\
- iothreadadd --domain fc4 --id 6;\
- iothreadinfo --domain fc4", NULL};
- const char *exp = "\
- IOThread ID CPU Affinity\n\
------------------------------\n\
- 2 0\n\
- 4 0\n\
-\n\
-\n\
- IOThread ID CPU Affinity\n\
------------------------------\n\
- 2 0\n\
- 4 0\n\
- 6 0\n\
-\n";
- return testCompareOutputLit((const char *) data, exp, NULL, argv);
-}
-
-static int testIOThreadDel(const void *data)
-{
- const char *const argv[] = { VIRSH_CUSTOM, "iothreadinfo --domain fc4;\
- iothreaddel --domain fc4 --id 2;\
- iothreadinfo --domain fc4", NULL};
- const char *exp = "\
- IOThread ID CPU Affinity\n\
------------------------------\n\
- 2 0\n\
- 4 0\n\
-\n\
-\n\
- IOThread ID CPU Affinity\n\
------------------------------\n\
- 4 0\n\
-\n";
- return testCompareOutputLit((const char *) data, exp, NULL, argv);
-}
-
-static int testIOThreadSet(const void *data)
-{
- const char *const argv[] = { VIRSH_CUSTOM, "domstats --domain fc4;\
- iothreadset --domain fc4\
- --id 2 --poll-max-ns 100\
- --poll-shrink 10 --poll-grow 10;\
- domstats --domain fc4", NULL};
- const char *exp = "\
-Domain: 'fc4'\n\
- state.state" EQUAL "1\n\
- state.reason" EQUAL "0\n\
- iothread.count" EQUAL "2\n\
- iothread.2.poll-max-ns" EQUAL "32768\n\
- iothread.2.poll-grow" EQUAL "0\n\
- iothread.2.poll-shrink" EQUAL "0\n\
- iothread.4.poll-max-ns" EQUAL "32768\n\
- iothread.4.poll-grow" EQUAL "0\n\
- iothread.4.poll-shrink" EQUAL "0\n\n\
-\n\
-Domain: 'fc4'\n\
- state.state" EQUAL "1\n\
- state.reason" EQUAL "0\n\
- iothread.count" EQUAL "2\n\
- iothread.2.poll-max-ns" EQUAL "100\n\
- iothread.2.poll-grow" EQUAL "10\n\
- iothread.2.poll-shrink" EQUAL "10\n\
- iothread.4.poll-max-ns" EQUAL "32768\n\
- iothread.4.poll-grow" EQUAL "0\n\
- iothread.4.poll-shrink" EQUAL "0\n\n";
- return testCompareOutputLit((const char *) data, exp, NULL, argv);
-}
-
-static int testIOThreadPin(const void *data)
-{
- const char *const argv[] = { VIRSH_CUSTOM,
- "iothreadadd --domain fc5 --id 2;\
- iothreadinfo --domain fc5;\
- iothreadpin --domain fc5 --iothread 2\
- --cpulist 0;\
- iothreadinfo --domain fc5", NULL};
- const char *exp = "\n\
- IOThread ID CPU Affinity\n\
------------------------------\n\
- 2 0-3\n\
-\n\
-\n\
- IOThread ID CPU Affinity\n\
------------------------------\n\
- 2 0\n\
-\n";
- return testCompareOutputLit((const char *) data, exp, NULL, argv);
-}
-
struct testInfo {
const char *testname; /* used to generate output filename */
const char *filter;
custom_uri = g_strdup_printf("test://%s/../examples/xml/test/testnode.xml",
abs_srcdir);
- if (virTestRun("virsh iothreadadd",
- testIOThreadAdd, NULL) != 0)
- ret = -1;
-
- if (virTestRun("virsh iothreaddel",
- testIOThreadDel, NULL) != 0)
- ret = -1;
-
- if (virTestRun("virsh iothreadset",
- testIOThreadSet, NULL) != 0)
- ret = -1;
-
- if (virTestRun("virsh iothreadpin",
- testIOThreadPin, NULL) != 0)
- ret = -1;
-
# define DO_TEST_SCRIPT(testname_, testfilter, ...) \
{ \
const char *testname = testname_; \
DO_TEST_SCRIPT("info-custom", NULL, VIRSH_CUSTOM);
DO_TEST_SCRIPT("domain-id", "\nCPU time:", VIRSH_CUSTOM);
DO_TEST_SCRIPT("blkiotune", NULL, VIRSH_CUSTOM);
+ DO_TEST_SCRIPT("iothreads", NULL, VIRSH_CUSTOM);
# define DO_TEST_FULL(testname_, filter, ...) \
do { \
--- /dev/null
+ IOThread ID CPU Affinity
+-----------------------------
+ 2 0
+ 4 0
+
+
+ IOThread ID CPU Affinity
+-----------------------------
+ 2 0
+ 4 0
+ 6 0
+
+
+ IOThread ID CPU Affinity
+-----------------------------
+ 4 0
+ 6 0
+
+Domain: 'fc4'
+ state.state=1
+ state.reason=0
+ iothread.count=2
+ iothread.4.poll-max-ns=32768
+ iothread.4.poll-grow=0
+ iothread.4.poll-shrink=0
+ iothread.6.poll-max-ns=32768
+ iothread.6.poll-grow=0
+ iothread.6.poll-shrink=0
+
+
+Domain: 'fc4'
+ state.state=1
+ state.reason=0
+ iothread.count=2
+ iothread.4.poll-max-ns=32768
+ iothread.4.poll-grow=0
+ iothread.4.poll-shrink=0
+ iothread.6.poll-max-ns=100
+ iothread.6.poll-grow=10
+ iothread.6.poll-shrink=10
+
+
+ IOThread ID CPU Affinity
+-----------------------------
+ 2 0-3
+
+
+ IOThread ID CPU Affinity
+-----------------------------
+ 2 0
+