diff options
-rw-r--r-- | hw/i386/pc_piix.c | 19 | ||||
-rw-r--r-- | tests/qtest/device-introspect-test.c | 2 | ||||
-rw-r--r-- | tests/qtest/qom-test.c | 42 | ||||
-rw-r--r-- | tests/qtest/test-hmp.c | 2 |
4 files changed, 26 insertions, 39 deletions
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 9cceae3..22dee0e 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -948,13 +948,26 @@ DEFINE_PC_MACHINE(isapc, "isapc", pc_init_isa, #ifdef CONFIG_XEN -static void xenfv_machine_options(MachineClass *m) +static void xenfv_4_2_machine_options(MachineClass *m) { + pc_i440fx_4_2_machine_options(m); + m->desc = "Xen Fully-virtualized PC"; + m->max_cpus = HVM_MAX_VCPUS; + m->default_machine_opts = "accel=xen"; +} + +DEFINE_PC_MACHINE(xenfv_4_2, "xenfv-4.2", pc_xen_hvm_init, + xenfv_4_2_machine_options); + +static void xenfv_3_1_machine_options(MachineClass *m) +{ + pc_i440fx_3_1_machine_options(m); m->desc = "Xen Fully-virtualized PC"; + m->alias = "xenfv"; m->max_cpus = HVM_MAX_VCPUS; m->default_machine_opts = "accel=xen"; } -DEFINE_PC_MACHINE(xenfv, "xenfv", pc_xen_hvm_init, - xenfv_machine_options); +DEFINE_PC_MACHINE(xenfv, "xenfv-3.1", pc_xen_hvm_init, + xenfv_3_1_machine_options); #endif diff --git a/tests/qtest/device-introspect-test.c b/tests/qtest/device-introspect-test.c index 04f2290..f2c1576 100644 --- a/tests/qtest/device-introspect-test.c +++ b/tests/qtest/device-introspect-test.c @@ -288,7 +288,7 @@ static void add_machine_test_case(const char *mname) char *path, *args; /* Ignore blacklisted machines */ - if (g_str_equal("xenfv", mname) || g_str_equal("xenpv", mname)) { + if (!memcmp("xenfv", mname, 5) || g_str_equal("xenpv", mname)) { return; } diff --git a/tests/qtest/qom-test.c b/tests/qtest/qom-test.c index 4f94cc6..e338a41 100644 --- a/tests/qtest/qom-test.c +++ b/tests/qtest/qom-test.c @@ -15,35 +15,6 @@ #include "qemu/cutils.h" #include "libqtest.h" -static const char *blacklist_x86[] = { - "xenfv", "xenpv", NULL -}; - -static const struct { - const char *arch; - const char **machine; -} blacklists[] = { - { "i386", blacklist_x86 }, - { "x86_64", blacklist_x86 }, -}; - -static bool is_blacklisted(const char *arch, const char *mach) -{ - int i; - const char **p; - - for (i = 0; i < ARRAY_SIZE(blacklists); i++) { - if (!strcmp(blacklists[i].arch, arch)) { - for (p = blacklists[i].machine; *p; p++) { - if (!strcmp(*p, mach)) { - return true; - } - } - } - } - return false; -} - static void test_properties(QTestState *qts, const char *path, bool recurse) { char *child_path; @@ -108,13 +79,16 @@ static void test_machine(gconstpointer data) static void add_machine_test_case(const char *mname) { - const char *arch = qtest_get_arch(); + char *path; - if (!is_blacklisted(arch, mname)) { - char *path = g_strdup_printf("qom/%s", mname); - qtest_add_data_func(path, g_strdup(mname), test_machine); - g_free(path); + /* Ignore blacklisted machines that have known problems */ + if (!memcmp("xenfv", mname, 5) || g_str_equal("xenpv", mname)) { + return; } + + path = g_strdup_printf("qom/%s", mname); + qtest_add_data_func(path, g_strdup(mname), test_machine); + g_free(path); } int main(int argc, char **argv) diff --git a/tests/qtest/test-hmp.c b/tests/qtest/test-hmp.c index 5029c4d..f8aa5f9 100644 --- a/tests/qtest/test-hmp.c +++ b/tests/qtest/test-hmp.c @@ -143,7 +143,7 @@ static void add_machine_test_case(const char *mname) char *path; /* Ignore blacklisted machines that have known problems */ - if (!strcmp("xenfv", mname) || !strcmp("xenpv", mname)) { + if (!memcmp("xenfv", mname, 5) || g_str_equal("xenpv", mname)) { return; } |