Merge tag 'pull-request-2022-09-20' of https://gitlab.com/thuth/qemu into staging
* Skip tests if the corresponding feature is missing
* Update NetBSD VM test to version 9.3
* Update the FreeBSD CI to version 13.1
* Some small fixes for the qtests
* Update wordings in the QEMU guest-agent
# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmMpvqURHHRodXRoQHJl
# ZGhhdC5jb20ACgkQLtnXdP5wLbXtaQ//ap4P8Gdg7HyShflpHj3+Z+UC/THtcCAD
# F5Oj/E89wYJZJvWpjELLUf+218O+zbcKkv6z25AHo37JRSLQMzsD21RpDYcu8qnN
# Xk77KrOLFaVRRo6e3FAi5I+uWsm1h/9jJfC/sFrzfKGnWcW5pTzXUkbvWT3LZo/q
# d0wJCMn/+h0j6kqhjm8mhFCsGsSaUKFCMzm/6rsWxVsMsVnlTyYhg/IzhocKrkVD
# 9ZWz+jAv+h4F0CLl/SeRvZFq4LEGZoP3KHWrDAgEO9i1yC+tNpGDFyV/hJXwapcm
# jYGaPPgS2dLToMXf5uubfmyptircQKqdpC2Hl8UwgUS6OgwA2YRCxad8rrrdBezq
# 2Nb8KissVB8ySL1Asf00gxioJNwLKrY+4NIeDVxAQ56f1/9kd0w0ylrweR492V/p
# z3Yrs3uqqALR1jWfB7/Rh4EN2R0oe6bnlfb8bB6lzPKynXQicZLeoOnNPbkOQMw8
# HgjKVFT130ydXJKMJkgEQmi4JUGoaKqSKCmlSaHz9TAobwNiVBXaH0cyuX5QEuoX
# WgZosiF5nBzdbhkC2IPcQYHzIIkelfx9j9mKE0PNfUSkFgMiywcI5TfqabPWGeaA
# rxYPU4EZmbgCZPlBVdPFwog/BXap2EIo9+xtINM0COQDoy+Q/l5Z3keHhpjayBBS
# qWc6CRSmhLs=
# =sHK+
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 20 Sep 2022 09:22:45 EDT
# gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg: issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg: aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg: aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5
* tag 'pull-request-2022-09-20' of https://gitlab.com/thuth/qemu:
qga: Replace 'blacklist' and 'whitelist' in the guest agent sources
qga: Replace 'blacklist' command line and config file options by 'block-rpcs'
gitlab-ci: Update the FreeBSD 13 job from 13.0 to 13.1
tests: sb16 has both pc and q35 tests
tests: Only run intel-hda-tests if machine type is compiled in
bios-tables-test: Only run test for machine types compiled in
bios-tables-test: Sort all x86_64 tests by machine type
bios-tables-test: Make oem-fields tests be consistent
meson-build: Enable CONFIG_REPLICATION only when replication is set
tests: Fix error strings
qtest/fuzz-lsi53c895a-test: set guest RAM to 2G
tests/qtest: npcm7xx-emc-test: Skip checking MAC
.gitlab-ci.d/windows.yml: Drop the sed processing in the 64-bit build
tests/vm: update NetBSD to 9.3
tests: mark io-command test as skipped if socat is missing
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
diff --git a/.gitlab-ci.d/cirrus.yml b/.gitlab-ci.d/cirrus.yml
index 609c364..d70da61 100644
--- a/.gitlab-ci.d/cirrus.yml
+++ b/.gitlab-ci.d/cirrus.yml
@@ -63,7 +63,7 @@
NAME: freebsd-13
CIRRUS_VM_INSTANCE_TYPE: freebsd_instance
CIRRUS_VM_IMAGE_SELECTOR: image_family
- CIRRUS_VM_IMAGE_NAME: freebsd-13-0
+ CIRRUS_VM_IMAGE_NAME: freebsd-13-1
CIRRUS_VM_CPUS: 8
CIRRUS_VM_RAM: 8G
UPDATE_COMMAND: pkg update
diff --git a/.gitlab-ci.d/windows.yml b/.gitlab-ci.d/windows.yml
index da60139..86a4339 100644
--- a/.gitlab-ci.d/windows.yml
+++ b/.gitlab-ci.d/windows.yml
@@ -60,7 +60,6 @@
- $env:MSYS = 'winsymlinks:native' # Enable native Windows symlink
- .\msys64\usr\bin\bash -lc './configure --target-list=x86_64-softmmu
--enable-capstone --without-default-devices'
- - .\msys64\usr\bin\bash -lc "sed -i '/^ROMS=/d' build/config-host.mak"
- .\msys64\usr\bin\bash -lc 'make'
- .\msys64\usr\bin\bash -lc 'make check'
diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index c75a25d..8c914df 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -370,3 +370,22 @@
New deployments should use the Rust version, and existing systems
should consider moving to it. The command line and feature set
is very close and moving should be simple.
+
+
+QEMU guest agent
+----------------
+
+``--blacklist`` command line option (since 7.2)
+'''''''''''''''''''''''''''''''''''''''''''''''
+
+``--blacklist`` has been replaced by ``--block-rpcs`` (which is a better
+wording for what this option does). The short form ``-b`` still stays
+the same and thus is the preferred way for scripts that should run with
+both, older and future versions of QEMU.
+
+``blacklist`` config file option (since 7.2)
+''''''''''''''''''''''''''''''''''''''''''''
+
+The ``blacklist`` config file option has been renamed to ``block-rpcs``
+(to be in sync with the renaming of the corresponding command line
+option).
diff --git a/docs/interop/qemu-ga.rst b/docs/interop/qemu-ga.rst
index 3063357..a918380 100644
--- a/docs/interop/qemu-ga.rst
+++ b/docs/interop/qemu-ga.rst
@@ -79,10 +79,10 @@
Daemonize after startup (detach from terminal).
-.. option:: -b, --blacklist=LIST
+.. option:: -b, --block-rpcs=LIST
- Comma-separated list of RPCs to disable (no spaces, ``?`` to list
- available RPCs).
+ Comma-separated list of RPCs to disable (no spaces, use ``help`` to
+ list available RPCs).
.. option:: -D, --dump-conf
@@ -125,7 +125,7 @@
fsfreeze-hook string
statedir string
verbose boolean
-blacklist string list
+block-rpcs string list
============= ===========
See also
diff --git a/meson.build b/meson.build
index c2adb7c..3885fc1 100644
--- a/meson.build
+++ b/meson.build
@@ -1878,7 +1878,7 @@
config_host_data.set('CONFIG_GPROF', get_option('gprof'))
config_host_data.set('CONFIG_LIVE_BLOCK_MIGRATION', get_option('live_block_migration').allowed())
config_host_data.set('CONFIG_QOM_CAST_DEBUG', get_option('qom_cast_debug'))
-config_host_data.set('CONFIG_REPLICATION', get_option('live_block_migration').allowed())
+config_host_data.set('CONFIG_REPLICATION', get_option('replication').allowed())
# has_header
config_host_data.set('CONFIG_EPOLL', cc.has_header('sys/epoll.h'))
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 954efed..eea819c 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -3356,8 +3356,8 @@
}
#endif
-/* add unsupported commands to the blacklist */
-GList *ga_command_blacklist_init(GList *blacklist)
+/* add unsupported commands to the list of blocked RPCs */
+GList *ga_command_init_blockedrpcs(GList *blockedrpcs)
{
#if !defined(__linux__)
{
@@ -3370,13 +3370,13 @@
char **p = (char **)list;
while (*p) {
- blacklist = g_list_append(blacklist, g_strdup(*p++));
+ blockedrpcs = g_list_append(blockedrpcs, g_strdup(*p++));
}
}
#endif
#if !defined(HAVE_GETIFADDRS)
- blacklist = g_list_append(blacklist,
+ blockedrpcs = g_list_append(blockedrpcs,
g_strdup("guest-network-get-interfaces"));
#endif
@@ -3390,18 +3390,18 @@
char **p = (char **)list;
while (*p) {
- blacklist = g_list_append(blacklist, g_strdup(*p++));
+ blockedrpcs = g_list_append(blockedrpcs, g_strdup(*p++));
}
}
#endif
#if !defined(CONFIG_FSTRIM)
- blacklist = g_list_append(blacklist, g_strdup("guest-fstrim"));
+ blockedrpcs = g_list_append(blockedrpcs, g_strdup("guest-fstrim"));
#endif
- blacklist = g_list_append(blacklist, g_strdup("guest-get-devices"));
+ blockedrpcs = g_list_append(blockedrpcs, g_strdup("guest-get-devices"));
- return blacklist;
+ return blockedrpcs;
}
/* register init/cleanup routines for stateful command groups */
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index 7ed7664..ec9f55b 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -2005,8 +2005,8 @@
return NULL;
}
-/* add unsupported commands to the blacklist */
-GList *ga_command_blacklist_init(GList *blacklist)
+/* add unsupported commands to the list of blocked RPCs */
+GList *ga_command_init_blockedrpcs(GList *blockedrpcs)
{
const char *list_unsupported[] = {
"guest-suspend-hybrid",
@@ -2017,7 +2017,7 @@
char **p = (char **)list_unsupported;
while (*p) {
- blacklist = g_list_append(blacklist, g_strdup(*p++));
+ blockedrpcs = g_list_append(blockedrpcs, g_strdup(*p++));
}
if (!vss_init(true)) {
@@ -2028,11 +2028,11 @@
p = (char **)list;
while (*p) {
- blacklist = g_list_append(blacklist, g_strdup(*p++));
+ blockedrpcs = g_list_append(blockedrpcs, g_strdup(*p++));
}
}
- return blacklist;
+ return blockedrpcs;
}
/* register init/cleanup routines for stateful command groups */
diff --git a/qga/guest-agent-core.h b/qga/guest-agent-core.h
index 29cd504..b4e7c52 100644
--- a/qga/guest-agent-core.h
+++ b/qga/guest-agent-core.h
@@ -24,7 +24,7 @@
extern GAState *ga_state;
extern QmpCommandList ga_commands;
-GList *ga_command_blacklist_init(GList *blacklist);
+GList *ga_command_init_blockedrpcs(GList *blockedrpcs);
void ga_command_state_init(GAState *s, GACommandState *cs);
void ga_command_state_add(GACommandState *cs,
void (*init)(void),
diff --git a/qga/main.c b/qga/main.c
index 5f1efa2..5a9d825 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -87,7 +87,7 @@
#endif
bool delimit_response;
bool frozen;
- GList *blacklist;
+ GList *blockedrpcs;
char *state_filepath_isfrozen;
struct {
const char *log_filepath;
@@ -107,7 +107,7 @@
QmpCommandList ga_commands;
/* commands that are safe to issue while filesystems are frozen */
-static const char *ga_freeze_whitelist[] = {
+static const char *ga_freeze_allowlist[] = {
"guest-ping",
"guest-info",
"guest-sync",
@@ -260,8 +260,8 @@
#ifdef _WIN32
" -s, --service service commands: install, uninstall, vss-install, vss-uninstall\n"
#endif
-" -b, --blacklist comma-separated list of RPCs to disable (no spaces, \"?\"\n"
-" to list available RPCs)\n"
+" -b, --block-rpcs comma-separated list of RPCs to disable (no spaces,\n"
+" use \"help\" to list available RPCs)\n"
" -D, --dump-conf dump a qemu-ga config file based on current config\n"
" options / command-line parameters to stdout\n"
" -r, --retry-path attempt re-opening path if it's unavailable or closed\n"
@@ -363,31 +363,31 @@
}
/* disable commands that aren't safe for fsfreeze */
-static void ga_disable_non_whitelisted(const QmpCommand *cmd, void *opaque)
+static void ga_disable_not_allowed(const QmpCommand *cmd, void *opaque)
{
- bool whitelisted = false;
+ bool allowed = false;
int i = 0;
const char *name = qmp_command_name(cmd);
- while (ga_freeze_whitelist[i] != NULL) {
- if (strcmp(name, ga_freeze_whitelist[i]) == 0) {
- whitelisted = true;
+ while (ga_freeze_allowlist[i] != NULL) {
+ if (strcmp(name, ga_freeze_allowlist[i]) == 0) {
+ allowed = true;
}
i++;
}
- if (!whitelisted) {
+ if (!allowed) {
g_debug("disabling command: %s", name);
qmp_disable_command(&ga_commands, name, "the agent is in frozen state");
}
}
-/* [re-]enable all commands, except those explicitly blacklisted by user */
-static void ga_enable_non_blacklisted(const QmpCommand *cmd, void *opaque)
+/* [re-]enable all commands, except those explicitly blocked by user */
+static void ga_enable_non_blocked(const QmpCommand *cmd, void *opaque)
{
- GList *blacklist = opaque;
+ GList *blockedrpcs = opaque;
const char *name = qmp_command_name(cmd);
- if (g_list_find_custom(blacklist, name, ga_strcmp) == NULL &&
+ if (g_list_find_custom(blockedrpcs, name, ga_strcmp) == NULL &&
!qmp_command_is_enabled(cmd)) {
g_debug("enabling command: %s", name);
qmp_enable_command(&ga_commands, name);
@@ -426,8 +426,8 @@
if (ga_is_frozen(s)) {
return;
}
- /* disable all non-whitelisted (for frozen state) commands */
- qmp_for_each_command(&ga_commands, ga_disable_non_whitelisted, NULL);
+ /* disable all forbidden (for frozen state) commands */
+ qmp_for_each_command(&ga_commands, ga_disable_not_allowed, NULL);
g_warning("disabling logging due to filesystem freeze");
ga_disable_logging(s);
s->frozen = true;
@@ -465,8 +465,8 @@
s->deferred_options.pid_filepath = NULL;
}
- /* enable all disabled, non-blacklisted commands */
- qmp_for_each_command(&ga_commands, ga_enable_non_blacklisted, s->blacklist);
+ /* enable all disabled, non-blocked commands */
+ qmp_for_each_command(&ga_commands, ga_enable_non_blocked, s->blockedrpcs);
s->frozen = false;
if (!ga_delete_file(s->state_filepath_isfrozen)) {
g_warning("unable to delete %s, fsfreeze may not function properly",
@@ -896,7 +896,8 @@
int64_t handle;
g_assert(s->pstate_filepath);
- /* we blacklist commands and avoid operations that potentially require
+ /*
+ * We block commands and avoid operations that potentially require
* writing to disk when we're in a frozen state. this includes opening
* new files, so we should never get here in that situation
*/
@@ -950,8 +951,8 @@
#ifdef _WIN32
const char *service;
#endif
- gchar *bliststr; /* blacklist may point to this string */
- GList *blacklist;
+ gchar *bliststr; /* blockedrpcs may point to this string */
+ GList *blockedrpcs;
int daemonize;
GLogLevelFlags log_level;
int dumpconf;
@@ -963,6 +964,7 @@
GError *gerr = NULL;
GKeyFile *keyfile;
g_autofree char *conf = g_strdup(g_getenv("QGA_CONF")) ?: get_relocated_path(QGA_CONF_DEFAULT);
+ const gchar *blockrpcs_key = "block-rpcs";
/* read system config */
keyfile = g_key_file_new();
@@ -1009,10 +1011,16 @@
config->retry_path =
g_key_file_get_boolean(keyfile, "general", "retry-path", &gerr);
}
+
if (g_key_file_has_key(keyfile, "general", "blacklist", NULL)) {
+ g_warning("config using deprecated 'blacklist' key, should be replaced"
+ " with the 'block-rpcs' key.");
+ blockrpcs_key = "blacklist";
+ }
+ if (g_key_file_has_key(keyfile, "general", blockrpcs_key, NULL)) {
config->bliststr =
- g_key_file_get_string(keyfile, "general", "blacklist", &gerr);
- config->blacklist = g_list_concat(config->blacklist,
+ g_key_file_get_string(keyfile, "general", blockrpcs_key, &gerr);
+ config->blockedrpcs = g_list_concat(config->blockedrpcs,
split_list(config->bliststr, ","));
}
@@ -1072,8 +1080,8 @@
config->log_level == G_LOG_LEVEL_MASK);
g_key_file_set_boolean(keyfile, "general", "retry-path",
config->retry_path);
- tmp = list_join(config->blacklist, ',');
- g_key_file_set_string(keyfile, "general", "blacklist", tmp);
+ tmp = list_join(config->blockedrpcs, ',');
+ g_key_file_set_string(keyfile, "general", "block-rpcs", tmp);
g_free(tmp);
tmp = g_key_file_to_data(keyfile, NULL, &error);
@@ -1105,7 +1113,8 @@
{ "method", 1, NULL, 'm' },
{ "path", 1, NULL, 'p' },
{ "daemonize", 0, NULL, 'd' },
- { "blacklist", 1, NULL, 'b' },
+ { "block-rpcs", 1, NULL, 'b' },
+ { "blacklist", 1, NULL, 'b' }, /* deprecated alias for 'block-rpcs' */
#ifdef _WIN32
{ "service", 1, NULL, 's' },
#endif
@@ -1163,8 +1172,8 @@
qmp_for_each_command(&ga_commands, ga_print_cmd, NULL);
exit(EXIT_SUCCESS);
}
- config->blacklist = g_list_concat(config->blacklist,
- split_list(optarg, ","));
+ config->blockedrpcs = g_list_concat(config->blockedrpcs,
+ split_list(optarg, ","));
break;
}
#ifdef _WIN32
@@ -1218,7 +1227,7 @@
#ifdef CONFIG_FSFREEZE
g_free(config->fsfreeze_hook);
#endif
- g_list_free_full(config->blacklist, g_free);
+ g_list_free_full(config->blockedrpcs, g_free);
g_free(config);
}
@@ -1302,7 +1311,7 @@
s->deferred_options.log_filepath = config->log_filepath;
}
ga_disable_logging(s);
- qmp_for_each_command(&ga_commands, ga_disable_non_whitelisted, NULL);
+ qmp_for_each_command(&ga_commands, ga_disable_not_allowed, NULL);
} else {
if (config->daemonize) {
become_daemon(config->pid_filepath);
@@ -1326,10 +1335,10 @@
return NULL;
}
- config->blacklist = ga_command_blacklist_init(config->blacklist);
- if (config->blacklist) {
- GList *l = config->blacklist;
- s->blacklist = config->blacklist;
+ config->blockedrpcs = ga_command_init_blockedrpcs(config->blockedrpcs);
+ if (config->blockedrpcs) {
+ GList *l = config->blockedrpcs;
+ s->blockedrpcs = config->blockedrpcs;
do {
g_debug("disabling command: %s", (char *)l->data);
qmp_disable_command(&ga_commands, l->data, NULL);
diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
index 869399e..026a56f 100644
--- a/qga/qapi-schema.json
+++ b/qga/qapi-schema.json
@@ -16,8 +16,8 @@
{ 'pragma': { 'doc-required': true } }
-# Whitelists to permit QAPI rule violations; think twice before you
-# add to them!
+# Lists with items allowed to permit QAPI rule violations; think twice
+# before you add to them!
{ 'pragma': {
# Types whose member names may use '_'
'member-name-exceptions': [
diff --git a/tests/data/test-qga-config b/tests/data/test-qga-config
index 4bb721a..b6b7bc9 100644
--- a/tests/data/test-qga-config
+++ b/tests/data/test-qga-config
@@ -5,4 +5,4 @@
pidfile=/var/foo/qemu-ga.pid
statedir=/var/state
verbose=true
-blacklist=guest-ping;guest-get-time
+block-rpcs=guest-ping;guest-get-time
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index 3678396..46a46fe 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -1671,7 +1671,7 @@
}
}
-static void test_acpi_oem_fields_pc(void)
+static void test_acpi_piix4_oem_fields(void)
{
test_data data;
char *args;
@@ -1691,7 +1691,7 @@
g_free(args);
}
-static void test_acpi_oem_fields_q35(void)
+static void test_acpi_q35_oem_fields(void)
{
test_data data;
char *args;
@@ -1711,7 +1711,7 @@
g_free(args);
}
-static void test_acpi_oem_fields_microvm(void)
+static void test_acpi_microvm_oem_fields(void)
{
test_data data;
char *args;
@@ -1728,7 +1728,7 @@
g_free(args);
}
-static void test_acpi_oem_fields_virt(void)
+static void test_acpi_virt_oem_fields(void)
{
test_data data = {
.machine = "virt",
@@ -1766,85 +1766,102 @@
if (ret) {
return ret;
}
- qtest_add_func("acpi/q35/oem-fields", test_acpi_oem_fields_q35);
- if (tpm_model_is_available("-machine q35", "tpm-tis")) {
- qtest_add_func("acpi/q35/tpm2-tis", test_acpi_q35_tcg_tpm2_tis);
- qtest_add_func("acpi/q35/tpm12-tis", test_acpi_q35_tcg_tpm12_tis);
+ if (qtest_has_machine(MACHINE_PC)) {
+ qtest_add_func("acpi/piix4", test_acpi_piix4_tcg);
+ qtest_add_func("acpi/piix4/oem-fields", test_acpi_piix4_oem_fields);
+ qtest_add_func("acpi/piix4/bridge", test_acpi_piix4_tcg_bridge);
+ qtest_add_func("acpi/piix4/pci-hotplug/no_root_hotplug",
+ test_acpi_piix4_no_root_hotplug);
+ qtest_add_func("acpi/piix4/pci-hotplug/no_bridge_hotplug",
+ test_acpi_piix4_no_bridge_hotplug);
+ qtest_add_func("acpi/piix4/pci-hotplug/off",
+ test_acpi_piix4_no_acpi_pci_hotplug);
+ qtest_add_func("acpi/piix4/ipmi", test_acpi_piix4_tcg_ipmi);
+ qtest_add_func("acpi/piix4/cpuhp", test_acpi_piix4_tcg_cphp);
+ qtest_add_func("acpi/piix4/memhp", test_acpi_piix4_tcg_memhp);
+ qtest_add_func("acpi/piix4/numamem", test_acpi_piix4_tcg_numamem);
+ qtest_add_func("acpi/piix4/nosmm", test_acpi_piix4_tcg_nosmm);
+ qtest_add_func("acpi/piix4/smm-compat",
+ test_acpi_piix4_tcg_smm_compat);
+ qtest_add_func("acpi/piix4/smm-compat-nosmm",
+ test_acpi_piix4_tcg_smm_compat_nosmm);
+ qtest_add_func("acpi/piix4/nohpet", test_acpi_piix4_tcg_nohpet);
+ qtest_add_func("acpi/piix4/dimmpxm", test_acpi_piix4_tcg_dimm_pxm);
+ qtest_add_func("acpi/piix4/acpihmat",
+ test_acpi_piix4_tcg_acpi_hmat);
+#ifdef CONFIG_POSIX
+ qtest_add_func("acpi/piix4/acpierst", test_acpi_piix4_acpi_erst);
+#endif
}
- qtest_add_func("acpi/piix4", test_acpi_piix4_tcg);
- qtest_add_func("acpi/oem-fields", test_acpi_oem_fields_pc);
- qtest_add_func("acpi/piix4/bridge", test_acpi_piix4_tcg_bridge);
- qtest_add_func("acpi/piix4/pci-hotplug/no_root_hotplug",
- test_acpi_piix4_no_root_hotplug);
- qtest_add_func("acpi/piix4/pci-hotplug/no_bridge_hotplug",
- test_acpi_piix4_no_bridge_hotplug);
- qtest_add_func("acpi/piix4/pci-hotplug/off",
- test_acpi_piix4_no_acpi_pci_hotplug);
- qtest_add_func("acpi/q35", test_acpi_q35_tcg);
- qtest_add_func("acpi/q35/bridge", test_acpi_q35_tcg_bridge);
- qtest_add_func("acpi/q35/multif-bridge", test_acpi_q35_multif_bridge);
- qtest_add_func("acpi/q35/mmio64", test_acpi_q35_tcg_mmio64);
- qtest_add_func("acpi/piix4/ipmi", test_acpi_piix4_tcg_ipmi);
- qtest_add_func("acpi/q35/ipmi", test_acpi_q35_tcg_ipmi);
- qtest_add_func("acpi/q35/smbus/ipmi", test_acpi_q35_tcg_smbus_ipmi);
- qtest_add_func("acpi/piix4/cpuhp", test_acpi_piix4_tcg_cphp);
- qtest_add_func("acpi/q35/cpuhp", test_acpi_q35_tcg_cphp);
- qtest_add_func("acpi/piix4/memhp", test_acpi_piix4_tcg_memhp);
- qtest_add_func("acpi/q35/memhp", test_acpi_q35_tcg_memhp);
- qtest_add_func("acpi/piix4/numamem", test_acpi_piix4_tcg_numamem);
- qtest_add_func("acpi/q35/numamem", test_acpi_q35_tcg_numamem);
- qtest_add_func("acpi/piix4/nosmm", test_acpi_piix4_tcg_nosmm);
- qtest_add_func("acpi/piix4/smm-compat",
- test_acpi_piix4_tcg_smm_compat);
- qtest_add_func("acpi/piix4/smm-compat-nosmm",
- test_acpi_piix4_tcg_smm_compat_nosmm);
- qtest_add_func("acpi/piix4/nohpet", test_acpi_piix4_tcg_nohpet);
- qtest_add_func("acpi/q35/nosmm", test_acpi_q35_tcg_nosmm);
- qtest_add_func("acpi/q35/smm-compat",
- test_acpi_q35_tcg_smm_compat);
- qtest_add_func("acpi/q35/smm-compat-nosmm",
- test_acpi_q35_tcg_smm_compat_nosmm);
- qtest_add_func("acpi/q35/nohpet", test_acpi_q35_tcg_nohpet);
- qtest_add_func("acpi/piix4/dimmpxm", test_acpi_piix4_tcg_dimm_pxm);
- qtest_add_func("acpi/q35/dimmpxm", test_acpi_q35_tcg_dimm_pxm);
- qtest_add_func("acpi/piix4/acpihmat", test_acpi_piix4_tcg_acpi_hmat);
- qtest_add_func("acpi/q35/acpihmat", test_acpi_q35_tcg_acpi_hmat);
+ if (qtest_has_machine(MACHINE_Q35)) {
+ qtest_add_func("acpi/q35", test_acpi_q35_tcg);
+ qtest_add_func("acpi/q35/oem-fields", test_acpi_q35_oem_fields);
+ if (tpm_model_is_available("-machine q35", "tpm-tis")) {
+ qtest_add_func("acpi/q35/tpm2-tis", test_acpi_q35_tcg_tpm2_tis);
+ qtest_add_func("acpi/q35/tpm12-tis",
+ test_acpi_q35_tcg_tpm12_tis);
+ }
+ qtest_add_func("acpi/q35/bridge", test_acpi_q35_tcg_bridge);
+ qtest_add_func("acpi/q35/multif-bridge",
+ test_acpi_q35_multif_bridge);
+ qtest_add_func("acpi/q35/mmio64", test_acpi_q35_tcg_mmio64);
+ qtest_add_func("acpi/q35/ipmi", test_acpi_q35_tcg_ipmi);
+ qtest_add_func("acpi/q35/smbus/ipmi", test_acpi_q35_tcg_smbus_ipmi);
+ qtest_add_func("acpi/q35/cpuhp", test_acpi_q35_tcg_cphp);
+ qtest_add_func("acpi/q35/memhp", test_acpi_q35_tcg_memhp);
+ qtest_add_func("acpi/q35/numamem", test_acpi_q35_tcg_numamem);
+ qtest_add_func("acpi/q35/nosmm", test_acpi_q35_tcg_nosmm);
+ qtest_add_func("acpi/q35/smm-compat",
+ test_acpi_q35_tcg_smm_compat);
+ qtest_add_func("acpi/q35/smm-compat-nosmm",
+ test_acpi_q35_tcg_smm_compat_nosmm);
+ qtest_add_func("acpi/q35/nohpet", test_acpi_q35_tcg_nohpet);
+ qtest_add_func("acpi/q35/dimmpxm", test_acpi_q35_tcg_dimm_pxm);
+ qtest_add_func("acpi/q35/acpihmat", test_acpi_q35_tcg_acpi_hmat);
#ifdef CONFIG_POSIX
- qtest_add_func("acpi/piix4/acpierst", test_acpi_piix4_acpi_erst);
- qtest_add_func("acpi/q35/acpierst", test_acpi_q35_acpi_erst);
+ qtest_add_func("acpi/q35/acpierst", test_acpi_q35_acpi_erst);
#endif
- qtest_add_func("acpi/q35/applesmc", test_acpi_q35_applesmc);
- qtest_add_func("acpi/q35/pvpanic-isa", test_acpi_q35_pvpanic_isa);
- qtest_add_func("acpi/microvm", test_acpi_microvm_tcg);
- qtest_add_func("acpi/microvm/usb", test_acpi_microvm_usb_tcg);
- qtest_add_func("acpi/microvm/rtc", test_acpi_microvm_rtc_tcg);
- qtest_add_func("acpi/microvm/ioapic2", test_acpi_microvm_ioapic2_tcg);
- qtest_add_func("acpi/microvm/oem-fields", test_acpi_oem_fields_microvm);
- if (has_tcg) {
- qtest_add_func("acpi/q35/ivrs", test_acpi_q35_tcg_ivrs);
- if (strcmp(arch, "x86_64") == 0) {
- qtest_add_func("acpi/microvm/pcie", test_acpi_microvm_pcie_tcg);
+ qtest_add_func("acpi/q35/applesmc", test_acpi_q35_applesmc);
+ qtest_add_func("acpi/q35/pvpanic-isa", test_acpi_q35_pvpanic_isa);
+ if (has_tcg) {
+ qtest_add_func("acpi/q35/ivrs", test_acpi_q35_tcg_ivrs);
+ }
+ if (has_kvm) {
+ qtest_add_func("acpi/q35/kvm/xapic", test_acpi_q35_kvm_xapic);
+ qtest_add_func("acpi/q35/kvm/dmar", test_acpi_q35_kvm_dmar);
+ }
+ qtest_add_func("acpi/q35/viot", test_acpi_q35_viot);
#ifdef CONFIG_POSIX
- qtest_add_func("acpi/microvm/acpierst", test_acpi_microvm_acpi_erst);
+ qtest_add_func("acpi/q35/cxl", test_acpi_q35_cxl);
#endif
+ qtest_add_func("acpi/q35/slic", test_acpi_q35_slic);
+ }
+ if (qtest_has_machine("microvm")) {
+ qtest_add_func("acpi/microvm", test_acpi_microvm_tcg);
+ qtest_add_func("acpi/microvm/usb", test_acpi_microvm_usb_tcg);
+ qtest_add_func("acpi/microvm/rtc", test_acpi_microvm_rtc_tcg);
+ qtest_add_func("acpi/microvm/ioapic2",
+ test_acpi_microvm_ioapic2_tcg);
+ qtest_add_func("acpi/microvm/oem-fields",
+ test_acpi_microvm_oem_fields);
+ if (has_tcg) {
+ if (strcmp(arch, "x86_64") == 0) {
+ qtest_add_func("acpi/microvm/pcie",
+ test_acpi_microvm_pcie_tcg);
+#ifdef CONFIG_POSIX
+ qtest_add_func("acpi/microvm/acpierst",
+ test_acpi_microvm_acpi_erst);
+#endif
+ }
}
}
- if (has_kvm) {
- qtest_add_func("acpi/q35/kvm/xapic", test_acpi_q35_kvm_xapic);
- qtest_add_func("acpi/q35/kvm/dmar", test_acpi_q35_kvm_dmar);
- }
- qtest_add_func("acpi/q35/viot", test_acpi_q35_viot);
-#ifdef CONFIG_POSIX
- qtest_add_func("acpi/q35/cxl", test_acpi_q35_cxl);
-#endif
- qtest_add_func("acpi/q35/slic", test_acpi_q35_slic);
} else if (strcmp(arch, "aarch64") == 0) {
if (has_tcg) {
qtest_add_func("acpi/virt", test_acpi_virt_tcg);
qtest_add_func("acpi/virt/numamem", test_acpi_virt_tcg_numamem);
qtest_add_func("acpi/virt/memhp", test_acpi_virt_tcg_memhp);
qtest_add_func("acpi/virt/pxb", test_acpi_virt_tcg_pxb);
- qtest_add_func("acpi/virt/oem-fields", test_acpi_oem_fields_virt);
+ qtest_add_func("acpi/virt/oem-fields", test_acpi_virt_oem_fields);
qtest_add_func("acpi/virt/viot", test_acpi_virt_viot);
}
}
diff --git a/tests/qtest/e1000-test.c b/tests/qtest/e1000-test.c
index c387984..4e0d7a5 100644
--- a/tests/qtest/e1000-test.c
+++ b/tests/qtest/e1000-test.c
@@ -35,7 +35,7 @@
return &e1000->dev;
}
- fprintf(stderr, "%s not present in e1000e\n", interface);
+ fprintf(stderr, "%s not present in e1000\n", interface);
g_assert_not_reached();
}
diff --git a/tests/qtest/es1370-test.c b/tests/qtest/es1370-test.c
index adccdac..97ab65c 100644
--- a/tests/qtest/es1370-test.c
+++ b/tests/qtest/es1370-test.c
@@ -28,7 +28,7 @@
return &es1370->dev;
}
- fprintf(stderr, "%s not present in e1000e\n", interface);
+ fprintf(stderr, "%s not present in es1370\n", interface);
g_assert_not_reached();
}
diff --git a/tests/qtest/fuzz-lsi53c895a-test.c b/tests/qtest/fuzz-lsi53c895a-test.c
index b23d3ec..434c16b 100644
--- a/tests/qtest/fuzz-lsi53c895a-test.c
+++ b/tests/qtest/fuzz-lsi53c895a-test.c
@@ -21,7 +21,7 @@
return;
}
- s = qtest_init("-M q35 -m 4G -display none -nodefaults "
+ s = qtest_init("-M q35 -m 2G -display none -nodefaults "
"-device lsi53c895a,id=scsi "
"-device scsi-hd,drive=disk0 "
"-drive file=null-co://,id=disk0,if=none,format=raw");
diff --git a/tests/qtest/fuzz-sb16-test.c b/tests/qtest/fuzz-sb16-test.c
index a65826b..add2a2a 100644
--- a/tests/qtest/fuzz-sb16-test.c
+++ b/tests/qtest/fuzz-sb16-test.c
@@ -57,9 +57,13 @@
{
g_test_init(&argc, &argv, NULL);
- qtest_add_func("fuzz/test_fuzz_sb16/1c", test_fuzz_sb16_0x1c);
- qtest_add_func("fuzz/test_fuzz_sb16/91", test_fuzz_sb16_0x91);
- qtest_add_func("fuzz/test_fuzz_sb16/d4", test_fuzz_sb16_0xd4);
+ if (qtest_has_machine("q35")) {
+ qtest_add_func("fuzz/test_fuzz_sb16/1c", test_fuzz_sb16_0x1c);
+ }
+ if (qtest_has_machine("pc")) {
+ qtest_add_func("fuzz/test_fuzz_sb16/91", test_fuzz_sb16_0x91);
+ qtest_add_func("fuzz/test_fuzz_sb16/d4", test_fuzz_sb16_0xd4);
+ }
return g_test_run();
}
diff --git a/tests/qtest/intel-hda-test.c b/tests/qtest/intel-hda-test.c
index a58c98e..d4a8db6 100644
--- a/tests/qtest/intel-hda-test.c
+++ b/tests/qtest/intel-hda-test.c
@@ -18,7 +18,7 @@
/* Tests only initialization so far. TODO: Replace with functional tests */
static void ich6_test(void)
{
- qtest_start("-device intel-hda,id=" HDA_ID CODEC_DEVICES);
+ qtest_start("-machine pc -device intel-hda,id=" HDA_ID CODEC_DEVICES);
qtest_end();
}
@@ -65,9 +65,12 @@
int main(int argc, char **argv)
{
g_test_init(&argc, &argv, NULL);
- qtest_add_func("/intel-hda/ich6", ich6_test);
- qtest_add_func("/intel-hda/ich9", ich9_test);
- qtest_add_func("/intel-hda/fuzz/issue542", test_issue542_ich6);
-
+ if (qtest_has_machine("pc")) {
+ qtest_add_func("/intel-hda/ich6", ich6_test);
+ }
+ if (qtest_has_machine("q35")) {
+ qtest_add_func("/intel-hda/ich9", ich9_test);
+ qtest_add_func("/intel-hda/fuzz/issue542", test_issue542_ich6);
+ }
return g_test_run();
}
diff --git a/tests/qtest/npcm7xx_emc-test.c b/tests/qtest/npcm7xx_emc-test.c
index c373d24..b046f1d 100644
--- a/tests/qtest/npcm7xx_emc-test.c
+++ b/tests/qtest/npcm7xx_emc-test.c
@@ -381,7 +381,8 @@
#undef CHECK_REG
- for (i = 0; i < NUM_CAMML_REGS; ++i) {
+ /* Skip over the MAC address registers, which is BASE+0 */
+ for (i = 1; i < NUM_CAMML_REGS; ++i) {
g_assert_cmpuint(emc_read(qts, mod, REG_CAMM_BASE + i * 2), ==,
0);
g_assert_cmpuint(emc_read(qts, mod, REG_CAML_BASE + i * 2), ==,
diff --git a/tests/unit/test-io-channel-command.c b/tests/unit/test-io-channel-command.c
index 99056e0..aa09c55 100644
--- a/tests/unit/test-io-channel-command.c
+++ b/tests/unit/test-io-channel-command.c
@@ -41,7 +41,8 @@
unlink(TEST_FIFO);
if (access("/bin/socat", X_OK) < 0) {
- return; /* Pretend success if socat is not present */
+ g_test_skip("socat is missing");
+ return;
}
if (mkfifo(TEST_FIFO, 0600) < 0) {
abort();
diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c
index d27ff94..b6ea7c7 100644
--- a/tests/unit/test-qga.c
+++ b/tests/unit/test-qga.c
@@ -730,7 +730,7 @@
g_assert_true(g_key_file_get_boolean(kf, "general", "verbose", &error));
g_assert_no_error(error);
- strv = g_key_file_get_string_list(kf, "general", "blacklist", &n, &error);
+ strv = g_key_file_get_string_list(kf, "general", "block-rpcs", &n, &error);
g_assert_cmpint(n, ==, 2);
g_assert_true(g_strv_contains((const char * const *)strv,
"guest-ping"));
diff --git a/tests/vm/netbsd b/tests/vm/netbsd
index da6773f..aa54338 100755
--- a/tests/vm/netbsd
+++ b/tests/vm/netbsd
@@ -22,8 +22,8 @@
name = "netbsd"
arch = "x86_64"
- link = "https://cdn.netbsd.org/pub/NetBSD/NetBSD-9.2/images/NetBSD-9.2-amd64.iso"
- csum = "5ee0ea101f73386b9b424f5d1041e371db3c42fdd6f4e4518dc79c4a08f31d43091ebe93425c9f0dcaaed2b51131836fe6774f33f89030b58d64709b35fda72f"
+ link = "https://cdn.netbsd.org/pub/NetBSD/NetBSD-9.3/images/NetBSD-9.3-amd64.iso"
+ csum = "2bfce544f762a579f61478e7106c436fc48731ff25cf6f79b392ba5752e6f5ec130364286f7471716290a5f033637cf56aacee7fedb91095face59adf36300c3"
size = "20G"
pkgs = [
# tools