* [PULL 01/27] tests/qtest: netdev: test stream and dgram backends
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
@ 2023-01-31 10:11 ` Thomas Huth
2023-01-31 10:11 ` [PULL 02/27] tests/qtest/qom-test: Stop spamming the test log Thomas Huth
` (26 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:11 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Laurent Vivier, Michael S . Tsirkin
From: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20230118120405.1876329-1-lvivier@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qtest/netdev-socket.c | 448 ++++++++++++++++++++++++++++++++++++
tests/qtest/meson.build | 2 +
2 files changed, 450 insertions(+)
create mode 100644 tests/qtest/netdev-socket.c
diff --git a/tests/qtest/netdev-socket.c b/tests/qtest/netdev-socket.c
new file mode 100644
index 0000000000..6ba256e173
--- /dev/null
+++ b/tests/qtest/netdev-socket.c
@@ -0,0 +1,448 @@
+/*
+ * QTest testcase for netdev stream and dgram
+ *
+ * Copyright (c) 2022 Red Hat, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/sockets.h"
+#include <glib/gstdio.h>
+#include "../unit/socket-helpers.h"
+#include "libqtest.h"
+
+#define CONNECTION_TIMEOUT 5
+
+#define EXPECT_STATE(q, e, t) \
+do { \
+ char *resp = NULL; \
+ g_test_timer_start(); \
+ do { \
+ g_free(resp); \
+ resp = qtest_hmp(q, "info network"); \
+ if (t) { \
+ strrchr(resp, t)[0] = 0; \
+ } \
+ if (g_str_equal(resp, e)) { \
+ break; \
+ } \
+ } while (g_test_timer_elapsed() < CONNECTION_TIMEOUT); \
+ g_assert_cmpstr(resp, ==, e); \
+ g_free(resp); \
+} while (0)
+
+static gchar *tmpdir;
+
+static int inet_get_free_port_socket_ipv4(int sock)
+{
+ struct sockaddr_in addr;
+ socklen_t len;
+
+ memset(&addr, 0, sizeof(addr));
+ addr.sin_family = AF_INET;
+ addr.sin_addr.s_addr = INADDR_ANY;
+ addr.sin_port = 0;
+ if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
+ return -1;
+ }
+
+ len = sizeof(addr);
+ if (getsockname(sock, (struct sockaddr *)&addr, &len) < 0) {
+ return -1;
+ }
+
+ return ntohs(addr.sin_port);
+}
+
+static int inet_get_free_port_socket_ipv6(int sock)
+{
+ struct sockaddr_in6 addr;
+ socklen_t len;
+
+ memset(&addr, 0, sizeof(addr));
+ addr.sin6_family = AF_INET6;
+ addr.sin6_addr = in6addr_any;
+ addr.sin6_port = 0;
+ if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
+ return -1;
+ }
+
+ len = sizeof(addr);
+ if (getsockname(sock, (struct sockaddr *)&addr, &len) < 0) {
+ return -1;
+ }
+
+ return ntohs(addr.sin6_port);
+}
+
+static int inet_get_free_port_multiple(int nb, int *port, bool ipv6)
+{
+ int sock[nb];
+ int i;
+
+ for (i = 0; i < nb; i++) {
+ sock[i] = socket(ipv6 ? AF_INET6 : AF_INET, SOCK_STREAM, 0);
+ if (sock[i] < 0) {
+ break;
+ }
+ port[i] = ipv6 ? inet_get_free_port_socket_ipv6(sock[i]) :
+ inet_get_free_port_socket_ipv4(sock[i]);
+ if (port[i] == -1) {
+ break;
+ }
+ }
+
+ nb = i;
+ for (i = 0; i < nb; i++) {
+ closesocket(sock[i]);
+ }
+
+ return nb;
+}
+
+static int inet_get_free_port(bool ipv6)
+{
+ int nb, port;
+
+ nb = inet_get_free_port_multiple(1, &port, ipv6);
+ g_assert_cmpint(nb, ==, 1);
+
+ return port;
+}
+
+static void test_stream_inet_ipv4(void)
+{
+ QTestState *qts0, *qts1;
+ char *expect;
+ int port;
+
+ port = inet_get_free_port(false);
+ qts0 = qtest_initf("-nodefaults -M none "
+ "-netdev stream,id=st0,server=true,addr.type=inet,"
+ "addr.ipv4=on,addr.ipv6=off,"
+ "addr.host=127.0.0.1,addr.port=%d", port);
+
+ EXPECT_STATE(qts0, "st0: index=0,type=stream,\r\n", 0);
+
+ qts1 = qtest_initf("-nodefaults -M none "
+ "-netdev stream,server=false,id=st0,addr.type=inet,"
+ "addr.ipv4=on,addr.ipv6=off,"
+ "addr.host=127.0.0.1,addr.port=%d", port);
+
+ expect = g_strdup_printf("st0: index=0,type=stream,tcp:127.0.0.1:%d\r\n",
+ port);
+ EXPECT_STATE(qts1, expect, 0);
+ g_free(expect);
+
+ /* the port is unknown, check only the address */
+ EXPECT_STATE(qts0, "st0: index=0,type=stream,tcp:127.0.0.1", ':');
+
+ qtest_quit(qts1);
+ qtest_quit(qts0);
+}
+
+static void test_stream_inet_ipv6(void)
+{
+ QTestState *qts0, *qts1;
+ char *expect;
+ int port;
+
+ port = inet_get_free_port(true);
+ qts0 = qtest_initf("-nodefaults -M none "
+ "-netdev stream,id=st0,server=true,addr.type=inet,"
+ "addr.ipv4=off,addr.ipv6=on,"
+ "addr.host=::1,addr.port=%d", port);
+
+ EXPECT_STATE(qts0, "st0: index=0,type=stream,\r\n", 0);
+
+ qts1 = qtest_initf("-nodefaults -M none "
+ "-netdev stream,server=false,id=st0,addr.type=inet,"
+ "addr.ipv4=off,addr.ipv6=on,"
+ "addr.host=::1,addr.port=%d", port);
+
+ expect = g_strdup_printf("st0: index=0,type=stream,tcp:::1:%d\r\n",
+ port);
+ EXPECT_STATE(qts1, expect, 0);
+ g_free(expect);
+
+ /* the port is unknown, check only the address */
+ EXPECT_STATE(qts0, "st0: index=0,type=stream,tcp:::1", ':');
+
+ qtest_quit(qts1);
+ qtest_quit(qts0);
+}
+
+static void test_stream_unix(void)
+{
+ QTestState *qts0, *qts1;
+ char *expect;
+ gchar *path;
+
+ path = g_strconcat(tmpdir, "/stream_unix", NULL);
+
+ qts0 = qtest_initf("-nodefaults -M none "
+ "-netdev stream,id=st0,server=true,"
+ "addr.type=unix,addr.path=%s,",
+ path);
+
+ EXPECT_STATE(qts0, "st0: index=0,type=stream,\r\n", 0);
+
+ qts1 = qtest_initf("-nodefaults -M none "
+ "-netdev stream,id=st0,server=false,"
+ "addr.type=unix,addr.path=%s",
+ path);
+
+ expect = g_strdup_printf("st0: index=0,type=stream,unix:%s\r\n", path);
+ EXPECT_STATE(qts1, expect, 0);
+ EXPECT_STATE(qts0, expect, 0);
+ g_free(expect);
+ g_free(path);
+
+ qtest_quit(qts1);
+ qtest_quit(qts0);
+}
+
+#ifdef CONFIG_LINUX
+static void test_stream_unix_abstract(void)
+{
+ QTestState *qts0, *qts1;
+ char *expect;
+ gchar *path;
+
+ path = g_strconcat(tmpdir, "/stream_unix_abstract", NULL);
+
+ qts0 = qtest_initf("-nodefaults -M none "
+ "-netdev stream,id=st0,server=true,"
+ "addr.type=unix,addr.path=%s,"
+ "addr.abstract=on",
+ path);
+
+ EXPECT_STATE(qts0, "st0: index=0,type=stream,\r\n", 0);
+
+ qts1 = qtest_initf("-nodefaults -M none "
+ "-netdev stream,id=st0,server=false,"
+ "addr.type=unix,addr.path=%s,addr.abstract=on",
+ path);
+
+ expect = g_strdup_printf("st0: index=0,type=stream,unix:%s\r\n", path);
+ EXPECT_STATE(qts1, expect, 0);
+ EXPECT_STATE(qts0, expect, 0);
+ g_free(expect);
+ g_free(path);
+
+ qtest_quit(qts1);
+ qtest_quit(qts0);
+}
+#endif
+
+#ifndef _WIN32
+static void test_stream_fd(void)
+{
+ QTestState *qts0, *qts1;
+ int sock[2];
+ int ret;
+
+ ret = socketpair(AF_LOCAL, SOCK_STREAM, 0, sock);
+ g_assert_true(ret == 0);
+
+ qts0 = qtest_initf("-nodefaults -M none "
+ "-netdev stream,id=st0,addr.type=fd,addr.str=%d",
+ sock[0]);
+
+ EXPECT_STATE(qts0, "st0: index=0,type=stream,unix:\r\n", 0);
+
+ qts1 = qtest_initf("-nodefaults -M none "
+ "-netdev stream,id=st0,addr.type=fd,addr.str=%d",
+ sock[1]);
+
+ EXPECT_STATE(qts1, "st0: index=0,type=stream,unix:\r\n", 0);
+ EXPECT_STATE(qts0, "st0: index=0,type=stream,unix:\r\n", 0);
+
+ qtest_quit(qts1);
+ qtest_quit(qts0);
+
+ closesocket(sock[0]);
+ closesocket(sock[1]);
+}
+#endif
+
+static void test_dgram_inet(void)
+{
+ QTestState *qts0, *qts1;
+ char *expect;
+ int port[2];
+ int nb;
+
+ nb = inet_get_free_port_multiple(2, port, false);
+ g_assert_cmpint(nb, ==, 2);
+
+ qts0 = qtest_initf("-nodefaults -M none "
+ "-netdev dgram,id=st0,"
+ "local.type=inet,local.host=127.0.0.1,local.port=%d,"
+ "remote.type=inet,remote.host=127.0.0.1,remote.port=%d",
+ port[0], port[1]);
+
+ expect = g_strdup_printf("st0: index=0,type=dgram,"
+ "udp=127.0.0.1:%d/127.0.0.1:%d\r\n",
+ port[0], port[1]);
+ EXPECT_STATE(qts0, expect, 0);
+ g_free(expect);
+
+ qts1 = qtest_initf("-nodefaults -M none "
+ "-netdev dgram,id=st0,"
+ "local.type=inet,local.host=127.0.0.1,local.port=%d,"
+ "remote.type=inet,remote.host=127.0.0.1,remote.port=%d",
+ port[1], port[0]);
+
+ expect = g_strdup_printf("st0: index=0,type=dgram,"
+ "udp=127.0.0.1:%d/127.0.0.1:%d\r\n",
+ port[1], port[0]);
+ EXPECT_STATE(qts1, expect, 0);
+ g_free(expect);
+
+ qtest_quit(qts1);
+ qtest_quit(qts0);
+}
+
+#ifndef _WIN32
+static void test_dgram_mcast(void)
+{
+ QTestState *qts;
+
+ qts = qtest_initf("-nodefaults -M none "
+ "-netdev dgram,id=st0,"
+ "remote.type=inet,remote.host=230.0.0.1,remote.port=1234");
+
+ EXPECT_STATE(qts, "st0: index=0,type=dgram,mcast=230.0.0.1:1234\r\n", 0);
+
+ qtest_quit(qts);
+}
+
+static void test_dgram_unix(void)
+{
+ QTestState *qts0, *qts1;
+ char *expect;
+ gchar *path0, *path1;
+
+ path0 = g_strconcat(tmpdir, "/dgram_unix0", NULL);
+ path1 = g_strconcat(tmpdir, "/dgram_unix1", NULL);
+
+ qts0 = qtest_initf("-nodefaults -M none "
+ "-netdev dgram,id=st0,local.type=unix,local.path=%s,"
+ "remote.type=unix,remote.path=%s",
+ path0, path1);
+
+ expect = g_strdup_printf("st0: index=0,type=dgram,udp=%s:%s\r\n",
+ path0, path1);
+ EXPECT_STATE(qts0, expect, 0);
+ g_free(expect);
+
+ qts1 = qtest_initf("-nodefaults -M none "
+ "-netdev dgram,id=st0,local.type=unix,local.path=%s,"
+ "remote.type=unix,remote.path=%s",
+ path1, path0);
+
+
+ expect = g_strdup_printf("st0: index=0,type=dgram,udp=%s:%s\r\n",
+ path1, path0);
+ EXPECT_STATE(qts1, expect, 0);
+ g_free(expect);
+
+ unlink(path0);
+ g_free(path0);
+ unlink(path1);
+ g_free(path1);
+
+ qtest_quit(qts1);
+ qtest_quit(qts0);
+}
+
+static void test_dgram_fd(void)
+{
+ QTestState *qts0, *qts1;
+ char *expect;
+ int ret;
+ int sv[2];
+
+ ret = socketpair(PF_UNIX, SOCK_DGRAM, 0, sv);
+ g_assert_cmpint(ret, !=, -1);
+
+ qts0 = qtest_initf("-nodefaults -M none "
+ "-netdev dgram,id=st0,local.type=fd,local.str=%d",
+ sv[0]);
+
+ expect = g_strdup_printf("st0: index=0,type=dgram,fd=%d unix\r\n", sv[0]);
+ EXPECT_STATE(qts0, expect, 0);
+ g_free(expect);
+
+ qts1 = qtest_initf("-nodefaults -M none "
+ "-netdev dgram,id=st0,local.type=fd,local.str=%d",
+ sv[1]);
+
+
+ expect = g_strdup_printf("st0: index=0,type=dgram,fd=%d unix\r\n", sv[1]);
+ EXPECT_STATE(qts1, expect, 0);
+ g_free(expect);
+
+ qtest_quit(qts1);
+ qtest_quit(qts0);
+
+ closesocket(sv[0]);
+ closesocket(sv[1]);
+}
+#endif
+
+int main(int argc, char **argv)
+{
+ int ret;
+ bool has_ipv4, has_ipv6, has_afunix;
+ g_autoptr(GError) err = NULL;
+
+ socket_init();
+ g_test_init(&argc, &argv, NULL);
+
+ if (socket_check_protocol_support(&has_ipv4, &has_ipv6) < 0) {
+ g_error("socket_check_protocol_support() failed\n");
+ }
+
+ tmpdir = g_dir_make_tmp("netdev-socket.XXXXXX", &err);
+ if (tmpdir == NULL) {
+ g_error("Can't create temporary directory in %s: %s",
+ g_get_tmp_dir(), err->message);
+ }
+
+ if (has_ipv4) {
+ qtest_add_func("/netdev/stream/inet/ipv4", test_stream_inet_ipv4);
+ qtest_add_func("/netdev/dgram/inet", test_dgram_inet);
+#ifndef _WIN32
+ qtest_add_func("/netdev/dgram/mcast", test_dgram_mcast);
+#endif
+ }
+ if (has_ipv6) {
+ qtest_add_func("/netdev/stream/inet/ipv6", test_stream_inet_ipv6);
+ }
+
+ socket_check_afunix_support(&has_afunix);
+ if (has_afunix) {
+#ifndef _WIN32
+ qtest_add_func("/netdev/dgram/unix", test_dgram_unix);
+#endif
+ qtest_add_func("/netdev/stream/unix", test_stream_unix);
+#ifdef CONFIG_LINUX
+ qtest_add_func("/netdev/stream/unix/abstract",
+ test_stream_unix_abstract);
+#endif
+#ifndef _WIN32
+ qtest_add_func("/netdev/stream/fd", test_stream_fd);
+ qtest_add_func("/netdev/dgram/fd", test_dgram_fd);
+#endif
+ }
+
+ ret = g_test_run();
+
+ g_rmdir(tmpdir);
+ g_free(tmpdir);
+
+ return ret;
+}
diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index 1af63f8bd2..e97616d327 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -21,6 +21,7 @@ qtests_generic = [
'test-hmp',
'qos-test',
'readconfig-test',
+ 'netdev-socket',
]
if config_host.has_key('CONFIG_MODULES')
qtests_generic += [ 'modules-test' ]
@@ -298,6 +299,7 @@ qtests = {
'tpm-tis-device-swtpm-test': [io, tpmemu_files, 'tpm-tis-util.c'],
'tpm-tis-device-test': [io, tpmemu_files, 'tpm-tis-util.c'],
'vmgenid-test': files('boot-sector.c', 'acpi-utils.c'),
+ 'netdev-socket': files('netdev-socket.c', '../unit/socket-helpers.c'),
}
gvnc = dependency('gvnc-1.0', required: false)
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 02/27] tests/qtest/qom-test: Stop spamming the test log
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
2023-01-31 10:11 ` [PULL 01/27] tests/qtest: netdev: test stream and dgram backends Thomas Huth
@ 2023-01-31 10:11 ` Thomas Huth
2023-01-31 10:11 ` [PULL 03/27] tests/qtest/bios-tables-test: Make the test less verbose by default Thomas Huth
` (25 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:11 UTC (permalink / raw)
To: Peter Maydell, qemu-devel
Cc: Daniel P . Berrangé, Philippe Mathieu-Daudé
We are still facing the issues that our test logs in the gitlab CI
are too big (and thus cut off). A huge part is still caused by the
qom-test that prints the path and name of each object it looks at
by default. That's too much. Let's be silent by default, and only
print the object path+name when running with V=2 (and the properties
only with V=3 and higher).
Message-Id: <20230118122557.1668860-1-thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qtest/qom-test.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/tests/qtest/qom-test.c b/tests/qtest/qom-test.c
index d380261f8f..d677f87c8e 100644
--- a/tests/qtest/qom-test.c
+++ b/tests/qtest/qom-test.c
@@ -14,7 +14,7 @@
#include "qemu/cutils.h"
#include "libqtest.h"
-static bool verbose;
+static int verbosity_level;
static void test_properties(QTestState *qts, const char *path, bool recurse)
{
@@ -24,7 +24,9 @@ static void test_properties(QTestState *qts, const char *path, bool recurse)
QListEntry *entry;
GSList *children = NULL, *links = NULL;
- g_test_message("Obtaining properties of %s", path);
+ if (verbosity_level >= 2) {
+ g_test_message("Obtaining properties of %s", path);
+ }
response = qtest_qmp(qts, "{ 'execute': 'qom-list',"
" 'arguments': { 'path': %s } }", path);
g_assert(response);
@@ -51,7 +53,7 @@ static void test_properties(QTestState *qts, const char *path, bool recurse)
}
} else {
const char *prop = qdict_get_str(tuple, "name");
- if (verbose) {
+ if (verbosity_level >= 3) {
g_test_message("-> %s", prop);
}
tmp = qtest_qmp(qts,
@@ -109,8 +111,8 @@ int main(int argc, char **argv)
{
char *v_env = getenv("V");
- if (v_env && atoi(v_env) >= 2) {
- verbose = true;
+ if (v_env) {
+ verbosity_level = atoi(v_env);
}
g_test_init(&argc, &argv, NULL);
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 03/27] tests/qtest/bios-tables-test: Make the test less verbose by default
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
2023-01-31 10:11 ` [PULL 01/27] tests/qtest: netdev: test stream and dgram backends Thomas Huth
2023-01-31 10:11 ` [PULL 02/27] tests/qtest/qom-test: Stop spamming the test log Thomas Huth
@ 2023-01-31 10:11 ` Thomas Huth
2023-01-31 10:11 ` [PULL 04/27] hw/misc/sifive_u_otp: Remove the deprecated OTP config with '-drive if=none' Thomas Huth
` (24 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:11 UTC (permalink / raw)
To: Peter Maydell, qemu-devel
Cc: Philippe Mathieu-Daudé, Igor Mammedov,
Daniel P . Berrangé
We are facing the issues that our test logs in the gitlab CI are
too big (and thus cut off). The bios-tables-test is one of the few
qtests that prints many lines of output by default when running with
V=1, so it contributes to this problem. Almost all other qtests are
silent with V=1 and only print debug messages with V=2 and higher.
Thus let's change the bios-tables-test to behave more like the
other tests and only print the debug messages with V=2 (or higher).
Message-Id: <20230118125132.1694469-1-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qtest/bios-tables-test.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index 8608408213..355d0c3d56 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -24,7 +24,7 @@
* You will also notice that tests/qtest/bios-tables-test-allowed-diff.h lists
* a bunch of files. This is your hint that you need to do the below:
* 4. Run
- * make check V=1
+ * make check V=2
* this will produce a bunch of warnings about differences
* beween actual and expected ACPI tables. If you have IASL installed,
* they will also be disassembled so you can look at the disassembled
@@ -108,6 +108,8 @@ static const char *iasl = CONFIG_IASL;
static const char *iasl;
#endif
+static int verbosity_level;
+
static bool compare_signature(const AcpiSdtTable *sdt, const char *signature)
{
return !memcmp(sdt->aml, signature, 4);
@@ -368,7 +370,7 @@ static GArray *load_expected_aml(test_data *data)
gsize aml_len;
GArray *exp_tables = g_array_new(false, true, sizeof(AcpiSdtTable));
- if (getenv("V")) {
+ if (verbosity_level >= 2) {
fputc('\n', stderr);
}
for (i = 0; i < data->tables->len; ++i) {
@@ -383,7 +385,7 @@ static GArray *load_expected_aml(test_data *data)
try_again:
aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machine,
sdt->aml, ext);
- if (getenv("V")) {
+ if (verbosity_level >= 2) {
fprintf(stderr, "Looking for expected file '%s'\n", aml_file);
}
if (g_file_test(aml_file, G_FILE_TEST_EXISTS)) {
@@ -395,7 +397,7 @@ try_again:
goto try_again;
}
g_assert(exp_sdt.aml_file);
- if (getenv("V")) {
+ if (verbosity_level >= 2) {
fprintf(stderr, "Using expected file '%s'\n", aml_file);
}
ret = g_file_get_contents(aml_file, (gchar **)&exp_sdt.aml,
@@ -503,7 +505,7 @@ static void test_acpi_asl(test_data *data)
exp_sdt->aml, sdt->asl_file, sdt->aml_file,
exp_sdt->asl_file, exp_sdt->aml_file);
fflush(stderr);
- if (getenv("V")) {
+ if (verbosity_level >= 1) {
const char *diff_env = getenv("DIFF");
const char *diff_cmd = diff_env ? diff_env : "diff -U 16";
char *diff = g_strdup_printf("%s %s %s", diff_cmd,
@@ -1974,8 +1976,13 @@ int main(int argc, char *argv[])
const char *arch = qtest_get_arch();
const bool has_kvm = qtest_has_accel("kvm");
const bool has_tcg = qtest_has_accel("tcg");
+ char *v_env = getenv("V");
int ret;
+ if (v_env) {
+ verbosity_level = atoi(v_env);
+ }
+
g_test_init(&argc, &argv, NULL);
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 04/27] hw/misc/sifive_u_otp: Remove the deprecated OTP config with '-drive if=none'
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (2 preceding siblings ...)
2023-01-31 10:11 ` [PULL 03/27] tests/qtest/bios-tables-test: Make the test less verbose by default Thomas Huth
@ 2023-01-31 10:11 ` Thomas Huth
2023-01-31 10:11 ` [PULL 05/27] configs/targets/nios2-softmmu: Add TARGET_NEED_FDT=y to the nios2 config Thomas Huth
` (23 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:11 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Alistair Francis, Philippe Mathieu-Daudé
'-drive if=none' is meant for configuring back-end devices only, so this
got marked as deprecated in QEMU 6.2. Users should now only use the new
way with '-drive if=pflash' instead.
Message-Id: <20230112083921.887828-1-thuth@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
docs/about/deprecated.rst | 6 ------
docs/about/removed-features.rst | 7 +++++++
hw/misc/sifive_u_otp.c | 7 -------
3 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index 9f1bbc495d..3f4d678eb4 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -87,12 +87,6 @@ as short-form boolean values, and passed to plugins as ``arg_name=on``.
However, short-form booleans are deprecated and full explicit ``arg_name=on``
form is preferred.
-``-drive if=none`` for the sifive_u OTP device (since 6.2)
-''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
-Using ``-drive if=none`` to configure the OTP device of the sifive_u
-RISC-V machine is deprecated. Use ``-drive if=pflash`` instead.
-
``-no-hpet`` (since 8.0)
''''''''''''''''''''''''
diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.rst
index 6c3aa5097f..a17d0554d6 100644
--- a/docs/about/removed-features.rst
+++ b/docs/about/removed-features.rst
@@ -422,6 +422,13 @@ the value is hexadecimal. That is, '0x20M' should be written either as
``tty`` and ``parport`` used to be aliases for ``serial`` and ``parallel``
respectively. The actual backend names should be used instead.
+``-drive if=none`` for the sifive_u OTP device (removed in 8.0)
+'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+Use ``-drive if=pflash`` to configure the OTP device of the sifive_u
+RISC-V machine instead.
+
+
QEMU Machine Protocol (QMP) commands
------------------------------------
diff --git a/hw/misc/sifive_u_otp.c b/hw/misc/sifive_u_otp.c
index 6d7fdb040a..8965f5c22a 100644
--- a/hw/misc/sifive_u_otp.c
+++ b/hw/misc/sifive_u_otp.c
@@ -210,13 +210,6 @@ static void sifive_u_otp_realize(DeviceState *dev, Error **errp)
sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->mmio);
dinfo = drive_get(IF_PFLASH, 0, 0);
- if (!dinfo) {
- dinfo = drive_get(IF_NONE, 0, 0);
- if (dinfo) {
- warn_report("using \"-drive if=none\" for the OTP is deprecated, "
- "use \"-drive if=pflash\" instead.");
- }
- }
if (dinfo) {
int ret;
uint64_t perm;
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 05/27] configs/targets/nios2-softmmu: Add TARGET_NEED_FDT=y to the nios2 config
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (3 preceding siblings ...)
2023-01-31 10:11 ` [PULL 04/27] hw/misc/sifive_u_otp: Remove the deprecated OTP config with '-drive if=none' Thomas Huth
@ 2023-01-31 10:11 ` Thomas Huth
2023-01-31 10:11 ` [PULL 06/27] travis.yml: Use the libfdt from the distro instead of the submodule Thomas Huth
` (22 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:11 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Philippe Mathieu-Daudé
qemu-system-nios2 uses the functions from libfdt in hw/nios2/boot.c,
so this target has to be marked with TARGET_NEED_FDT=y in its config
file.
Message-Id: <20230119125745.2028814-1-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
configs/targets/nios2-softmmu.mak | 1 +
1 file changed, 1 insertion(+)
diff --git a/configs/targets/nios2-softmmu.mak b/configs/targets/nios2-softmmu.mak
index 1e93b54cd1..5823fc02c8 100644
--- a/configs/targets/nios2-softmmu.mak
+++ b/configs/targets/nios2-softmmu.mak
@@ -1,2 +1,3 @@
TARGET_ARCH=nios2
TARGET_ALIGNED_ONLY=y
+TARGET_NEED_FDT=y
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 06/27] travis.yml: Use the libfdt from the distro instead of the submodule
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (4 preceding siblings ...)
2023-01-31 10:11 ` [PULL 05/27] configs/targets/nios2-softmmu: Add TARGET_NEED_FDT=y to the nios2 config Thomas Huth
@ 2023-01-31 10:11 ` Thomas Huth
2023-01-31 10:11 ` [PULL 07/27] travis.yml: Remove the generic addons section Thomas Huth
` (21 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:11 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Philippe Mathieu-Daudé
No need to compile-test third party submodules over and over again if
we can simply use the pre-build library from the distribution instead.
By also adding --enable-fdt=system to the configure options, we can
also avoid to check out the "dtc" submodule here.
Message-Id: <20230120075330.2076773-1-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
.travis.yml | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index fb3baabca9..788e14c08c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -128,6 +128,7 @@ jobs:
- libbrlapi-dev
- libcacard-dev
- libcap-ng-dev
+ - libfdt-dev
- libgcrypt20-dev
- libgnutls28-dev
- libgtk-3-dev
@@ -149,7 +150,8 @@ jobs:
- genisoimage
env:
- TEST_CMD="make check check-tcg V=1"
- - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS} --cxx=/bin/false"
+ - CONFIG="--disable-containers --enable-fdt=system
+ --target-list=${MAIN_SOFTMMU_TARGETS} --cxx=/bin/false"
- UNRELIABLE=true
- name: "[ppc64] GCC check-tcg"
@@ -162,6 +164,7 @@ jobs:
- libbrlapi-dev
- libcacard-dev
- libcap-ng-dev
+ - libfdt-dev
- libgcrypt20-dev
- libgnutls28-dev
- libgtk-3-dev
@@ -183,7 +186,8 @@ jobs:
- genisoimage
env:
- TEST_CMD="make check check-tcg V=1"
- - CONFIG="--disable-containers --target-list=ppc64-softmmu,ppc64le-linux-user"
+ - CONFIG="--disable-containers --enable-fdt=system
+ --target-list=ppc64-softmmu,ppc64le-linux-user"
- name: "[s390x] GCC check-tcg"
arch: s390x
@@ -195,6 +199,7 @@ jobs:
- libbrlapi-dev
- libcacard-dev
- libcap-ng-dev
+ - libfdt-dev
- libgcrypt20-dev
- libgnutls28-dev
- libgtk-3-dev
@@ -216,7 +221,8 @@ jobs:
- genisoimage
env:
- TEST_CMD="make check check-tcg V=1"
- - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS},s390x-linux-user"
+ - CONFIG="--disable-containers --enable-fdt=system
+ --target-list=${MAIN_SOFTMMU_TARGETS},s390x-linux-user"
- UNRELIABLE=true
script:
- BUILD_RC=0 && make -j${JOBS} || BUILD_RC=$?
@@ -237,6 +243,7 @@ jobs:
- libattr1-dev
- libcacard-dev
- libcap-ng-dev
+ - libfdt-dev
- libgnutls28-dev
- libiscsi-dev
- liblttng-ust-dev
@@ -255,8 +262,8 @@ jobs:
# Tests dependencies
- genisoimage
env:
- - CONFIG="--disable-containers --audio-drv-list=sdl --disable-user
- --target-list-exclude=${MAIN_SOFTMMU_TARGETS}"
+ - CONFIG="--disable-containers --enable-fdt=system --audio-drv-list=sdl
+ --disable-user --target-list-exclude=${MAIN_SOFTMMU_TARGETS}"
- name: "[s390x] GCC (user)"
arch: s390x
@@ -281,6 +288,7 @@ jobs:
- libbrlapi-dev
- libcacard-dev
- libcap-ng-dev
+ - libfdt-dev
- libgcrypt20-dev
- libgnutls28-dev
- libgtk-3-dev
@@ -300,6 +308,6 @@ jobs:
- ninja-build
env:
- TEST_CMD="make check-unit"
- - CONFIG="--disable-containers --disable-tcg --enable-kvm
- --disable-tools --host-cc=clang --cxx=clang++"
+ - CONFIG="--disable-containers --disable-tcg --enable-kvm --disable-tools
+ --enable-fdt=system --host-cc=clang --cxx=clang++"
- UNRELIABLE=true
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 07/27] travis.yml: Remove the generic addons section
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (5 preceding siblings ...)
2023-01-31 10:11 ` [PULL 06/27] travis.yml: Use the libfdt from the distro instead of the submodule Thomas Huth
@ 2023-01-31 10:11 ` Thomas Huth
2023-01-31 10:11 ` [PULL 08/27] tests/docker/dockerfiles: Add libfdt to the i386 and to the riscv64 container Thomas Huth
` (20 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:11 UTC (permalink / raw)
To: Peter Maydell, qemu-devel
Each job uses its own addons section nowadays, so the generic section
is completely unused and outdated, thus we can remove it now.
Message-Id: <20230119135914.2040853-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
.travis.yml | 37 -------------------------------------
1 file changed, 37 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 788e14c08c..cf088ba4cf 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,43 +16,6 @@ cache:
- $HOME/avocado/data/cache
-addons:
- apt:
- packages:
- # Build dependencies
- - libaio-dev
- - libattr1-dev
- - libbrlapi-dev
- - libcap-ng-dev
- - libcacard-dev
- - libgcc-7-dev
- - libgnutls28-dev
- - libgtk-3-dev
- - libiscsi-dev
- - liblttng-ust-dev
- - libncurses5-dev
- - libnfs-dev
- - libpixman-1-dev
- - libpng-dev
- - librados-dev
- - libsdl2-dev
- - libsdl2-image-dev
- - libseccomp-dev
- - libspice-protocol-dev
- - libspice-server-dev
- - libssh-dev
- - liburcu-dev
- - libusb-1.0-0-dev
- - libvdeplug-dev
- - libvte-2.91-dev
- - libzstd-dev
- - ninja-build
- - sparse
- - uuid-dev
- # Tests dependencies
- - genisoimage
-
-
# The channel name "irc.oftc.net#qemu" is encrypted against qemu/qemu
# to prevent IRC notifications from forks. This was created using:
# $ travis encrypt -r "qemu/qemu" "irc.oftc.net#qemu"
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 08/27] tests/docker/dockerfiles: Add libfdt to the i386 and to the riscv64 container
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (6 preceding siblings ...)
2023-01-31 10:11 ` [PULL 07/27] travis.yml: Remove the generic addons section Thomas Huth
@ 2023-01-31 10:11 ` Thomas Huth
2023-01-31 10:11 ` [PULL 09/27] qemu/bswap: Replace bswapXX() by compiler __builtin_bswap() Thomas Huth
` (19 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:11 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Philippe Mathieu-Daudé
No need to recompile the dtc submodule here again and again, we can
use the pre-built binary from the distribution instead.
(And this will also help in case we finally get rid of the dtc submodule
in QEMU one day)
Message-Id: <20230124143824.844040-1-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/docker/dockerfiles/debian-riscv64-cross.docker | 1 +
tests/docker/dockerfiles/fedora-i386-cross.docker | 1 +
2 files changed, 2 insertions(+)
diff --git a/tests/docker/dockerfiles/debian-riscv64-cross.docker b/tests/docker/dockerfiles/debian-riscv64-cross.docker
index 9715791e0b..3daf93968a 100644
--- a/tests/docker/dockerfiles/debian-riscv64-cross.docker
+++ b/tests/docker/dockerfiles/debian-riscv64-cross.docker
@@ -42,6 +42,7 @@ RUN apt update && \
apt install -y --no-install-recommends \
gcc-riscv64-linux-gnu \
libc6-dev-riscv64-cross \
+ libfdt-dev:riscv64 \
libffi-dev:riscv64 \
libglib2.0-dev:riscv64 \
libpixman-1-dev:riscv64
diff --git a/tests/docker/dockerfiles/fedora-i386-cross.docker b/tests/docker/dockerfiles/fedora-i386-cross.docker
index 7eec648d2d..f58b64dc3e 100644
--- a/tests/docker/dockerfiles/fedora-i386-cross.docker
+++ b/tests/docker/dockerfiles/fedora-i386-cross.docker
@@ -9,6 +9,7 @@ ENV PACKAGES \
findutils \
gcc \
git \
+ libfdt-devel.i686 \
libffi-devel.i686 \
libselinux-devel.i686 \
libtasn1-devel.i686 \
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 09/27] qemu/bswap: Replace bswapXX() by compiler __builtin_bswap()
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (7 preceding siblings ...)
2023-01-31 10:11 ` [PULL 08/27] tests/docker/dockerfiles: Add libfdt to the i386 and to the riscv64 container Thomas Huth
@ 2023-01-31 10:11 ` Thomas Huth
2023-01-31 10:11 ` [PULL 10/27] qemu/bswap: Replace bswapXXs() " Thomas Huth
` (18 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:11 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Philippe Mathieu-Daudé, Richard Henderson
From: Philippe Mathieu-Daudé <philmd@redhat.com>
Use the compiler built-in function to byte swap values,
as the compiler is clever and will fold constants.
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230111163147.71761-2-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
include/qemu/bswap.h | 31 ++++++-------------------------
1 file changed, 6 insertions(+), 25 deletions(-)
diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h
index 346d05f2aa..ca2b4c3f15 100644
--- a/include/qemu/bswap.h
+++ b/include/qemu/bswap.h
@@ -37,31 +37,12 @@ static inline uint64_t bswap64(uint64_t x)
#endif
#ifdef BSWAP_FROM_FALLBACKS
-static inline uint16_t bswap16(uint16_t x)
-{
- return (((x & 0x00ff) << 8) |
- ((x & 0xff00) >> 8));
-}
-
-static inline uint32_t bswap32(uint32_t x)
-{
- return (((x & 0x000000ffU) << 24) |
- ((x & 0x0000ff00U) << 8) |
- ((x & 0x00ff0000U) >> 8) |
- ((x & 0xff000000U) >> 24));
-}
-
-static inline uint64_t bswap64(uint64_t x)
-{
- return (((x & 0x00000000000000ffULL) << 56) |
- ((x & 0x000000000000ff00ULL) << 40) |
- ((x & 0x0000000000ff0000ULL) << 24) |
- ((x & 0x00000000ff000000ULL) << 8) |
- ((x & 0x000000ff00000000ULL) >> 8) |
- ((x & 0x0000ff0000000000ULL) >> 24) |
- ((x & 0x00ff000000000000ULL) >> 40) |
- ((x & 0xff00000000000000ULL) >> 56));
-}
+#undef bswap16
+#define bswap16(_x) __builtin_bswap16(_x)
+#undef bswap32
+#define bswap32(_x) __builtin_bswap32(_x)
+#undef bswap64
+#define bswap64(_x) __builtin_bswap64(_x)
#endif
#undef BSWAP_FROM_BYTESWAP
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 10/27] qemu/bswap: Replace bswapXXs() by compiler __builtin_bswap()
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (8 preceding siblings ...)
2023-01-31 10:11 ` [PULL 09/27] qemu/bswap: Replace bswapXX() by compiler __builtin_bswap() Thomas Huth
@ 2023-01-31 10:11 ` Thomas Huth
2023-01-31 10:11 ` [PULL 11/27] qemu/bswap: Remove <byteswap.h> dependency Thomas Huth
` (17 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:11 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Philippe Mathieu-Daudé, Richard Henderson
From: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230111163147.71761-3-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
include/qemu/bswap.h | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h
index ca2b4c3f15..d2dafdc54c 100644
--- a/include/qemu/bswap.h
+++ b/include/qemu/bswap.h
@@ -50,29 +50,31 @@ static inline uint64_t bswap64(uint64_t x)
static inline void bswap16s(uint16_t *s)
{
- *s = bswap16(*s);
+ *s = __builtin_bswap16(*s);
}
static inline void bswap32s(uint32_t *s)
{
- *s = bswap32(*s);
+ *s = __builtin_bswap32(*s);
}
static inline void bswap64s(uint64_t *s)
{
- *s = bswap64(*s);
+ *s = __builtin_bswap64(*s);
}
#if HOST_BIG_ENDIAN
#define be_bswap(v, size) (v)
-#define le_bswap(v, size) glue(bswap, size)(v)
+#define le_bswap(v, size) glue(__builtin_bswap, size)(v)
#define be_bswaps(v, size)
-#define le_bswaps(p, size) do { *p = glue(bswap, size)(*p); } while(0)
+#define le_bswaps(p, size) \
+ do { *p = glue(__builtin_bswap, size)(*p); } while (0)
#else
#define le_bswap(v, size) (v)
-#define be_bswap(v, size) glue(bswap, size)(v)
+#define be_bswap(v, size) glue(__builtin_bswap, size)(v)
#define le_bswaps(v, size)
-#define be_bswaps(p, size) do { *p = glue(bswap, size)(*p); } while(0)
+#define be_bswaps(p, size) \
+ do { *p = glue(__builtin_bswap, size)(*p); } while (0)
#endif
/**
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 11/27] qemu/bswap: Remove <byteswap.h> dependency
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (9 preceding siblings ...)
2023-01-31 10:11 ` [PULL 10/27] qemu/bswap: Replace bswapXXs() " Thomas Huth
@ 2023-01-31 10:11 ` Thomas Huth
2023-01-31 10:11 ` [PULL 12/27] qemu/bswap: Use compiler __builtin_bswap() on Haiku Thomas Huth
` (16 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:11 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Philippe Mathieu-Daudé, Richard Henderson
From: Philippe Mathieu-Daudé <philmd@redhat.com>
Since commit efc6c070aca ("configure: Add a test for the minimum
compiler version") the minimum compiler version required for GCC
is 4.8, which supports __builtin_bswap().
Drop the <byteswap.h> dependency.
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230111163147.71761-4-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
meson.build | 2 --
include/qemu/bswap.h | 21 ---------------------
2 files changed, 23 deletions(-)
diff --git a/meson.build b/meson.build
index 6d3b665629..7e15a010bf 100644
--- a/meson.build
+++ b/meson.build
@@ -2013,8 +2013,6 @@ if rdma.found()
endif
# has_header_symbol
-config_host_data.set('CONFIG_BYTESWAP_H',
- cc.has_header_symbol('byteswap.h', 'bswap_32'))
config_host_data.set('CONFIG_EPOLL_CREATE1',
cc.has_header_symbol('sys/epoll.h', 'epoll_create1'))
config_host_data.set('CONFIG_FALLOCATE_PUNCH_HOLE',
diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h
index d2dafdc54c..fd5a98125a 100644
--- a/include/qemu/bswap.h
+++ b/include/qemu/bswap.h
@@ -8,9 +8,6 @@
# include <sys/endian.h>
#elif defined(__HAIKU__)
# include <endian.h>
-#elif defined(CONFIG_BYTESWAP_H)
-# include <byteswap.h>
-#define BSWAP_FROM_BYTESWAP
# else
#define BSWAP_FROM_FALLBACKS
#endif /* ! CONFIG_MACHINE_BSWAP_H */
@@ -19,23 +16,6 @@
extern "C" {
#endif
-#ifdef BSWAP_FROM_BYTESWAP
-static inline uint16_t bswap16(uint16_t x)
-{
- return bswap_16(x);
-}
-
-static inline uint32_t bswap32(uint32_t x)
-{
- return bswap_32(x);
-}
-
-static inline uint64_t bswap64(uint64_t x)
-{
- return bswap_64(x);
-}
-#endif
-
#ifdef BSWAP_FROM_FALLBACKS
#undef bswap16
#define bswap16(_x) __builtin_bswap16(_x)
@@ -45,7 +25,6 @@ static inline uint64_t bswap64(uint64_t x)
#define bswap64(_x) __builtin_bswap64(_x)
#endif
-#undef BSWAP_FROM_BYTESWAP
#undef BSWAP_FROM_FALLBACKS
static inline void bswap16s(uint16_t *s)
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 12/27] qemu/bswap: Use compiler __builtin_bswap() on Haiku
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (10 preceding siblings ...)
2023-01-31 10:11 ` [PULL 11/27] qemu/bswap: Remove <byteswap.h> dependency Thomas Huth
@ 2023-01-31 10:11 ` Thomas Huth
2023-01-31 10:11 ` [PULL 13/27] qemu/bswap: Use compiler __builtin_bswap() on FreeBSD Thomas Huth
` (15 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:11 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Philippe Mathieu-Daudé, Richard Henderson
From: Philippe Mathieu-Daudé <philmd@redhat.com>
Since commit efc6c070aca ("configure: Add a test for the minimum
compiler version") the minimum compiler version required for GCC
is 4.8, which supports __builtin_bswap().
Remove the Haiku specific ifdef'ry.
This reverts commit 652a46ebba970017c7a23767dcc983265cdb8eb7
("bswap.h: Include <endian.h> on Haiku for bswap operations").
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230111163147.71761-5-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
include/qemu/bswap.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h
index fd5a98125a..8cd5a2b02e 100644
--- a/include/qemu/bswap.h
+++ b/include/qemu/bswap.h
@@ -6,8 +6,6 @@
# include <machine/bswap.h>
#elif defined(__FreeBSD__)
# include <sys/endian.h>
-#elif defined(__HAIKU__)
-# include <endian.h>
# else
#define BSWAP_FROM_FALLBACKS
#endif /* ! CONFIG_MACHINE_BSWAP_H */
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 13/27] qemu/bswap: Use compiler __builtin_bswap() on FreeBSD
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (11 preceding siblings ...)
2023-01-31 10:11 ` [PULL 12/27] qemu/bswap: Use compiler __builtin_bswap() on Haiku Thomas Huth
@ 2023-01-31 10:11 ` Thomas Huth
2023-01-31 10:11 ` [PULL 14/27] qemu/bswap: Use compiler __builtin_bswap() on NetBSD Thomas Huth
` (14 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:11 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Philippe Mathieu-Daudé, Richard Henderson
From: Philippe Mathieu-Daudé <philmd@redhat.com>
Since commit efc6c070aca ("configure: Add a test for the minimum
compiler version") the minimum compiler version required for GCC
is 4.8, which supports __builtin_bswap().
Remove the FreeBSD specific ifdef'ry.
This reverts commit de03c3164accc21311c39327601fcdd95da301f3
("bswap: Fix build on FreeBSD 10.0").
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230111163147.71761-6-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
include/qemu/bswap.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h
index 8cd5a2b02e..32d5cdec27 100644
--- a/include/qemu/bswap.h
+++ b/include/qemu/bswap.h
@@ -4,8 +4,6 @@
#ifdef CONFIG_MACHINE_BSWAP_H
# include <sys/endian.h>
# include <machine/bswap.h>
-#elif defined(__FreeBSD__)
-# include <sys/endian.h>
# else
#define BSWAP_FROM_FALLBACKS
#endif /* ! CONFIG_MACHINE_BSWAP_H */
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 14/27] qemu/bswap: Use compiler __builtin_bswap() on NetBSD
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (12 preceding siblings ...)
2023-01-31 10:11 ` [PULL 13/27] qemu/bswap: Use compiler __builtin_bswap() on FreeBSD Thomas Huth
@ 2023-01-31 10:11 ` Thomas Huth
2023-01-31 10:11 ` [PULL 15/27] MAINTAINERS: Abort HAXM maintenance Thomas Huth
` (13 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:11 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Philippe Mathieu-Daudé, Richard Henderson
From: Philippe Mathieu-Daudé <philmd@redhat.com>
Since commit efc6c070aca ("configure: Add a test for the minimum
compiler version") the minimum compiler version required for GCC
is 4.8, which supports __builtin_bswap().
Remove the NetBSD specific ifdef'ry.
This reverts commit 1360677cfe3ca8f945fa1de77823df21a77e4500
("makes NetBSD use the native bswap functions").
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230111163147.71761-7-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
meson.build | 4 ----
include/qemu/bswap.h | 11 -----------
2 files changed, 15 deletions(-)
diff --git a/meson.build b/meson.build
index 7e15a010bf..a03d3dbd3a 100644
--- a/meson.build
+++ b/meson.build
@@ -2030,10 +2030,6 @@ config_host_data.set('CONFIG_INOTIFY',
cc.has_header_symbol('sys/inotify.h', 'inotify_init'))
config_host_data.set('CONFIG_INOTIFY1',
cc.has_header_symbol('sys/inotify.h', 'inotify_init1'))
-config_host_data.set('CONFIG_MACHINE_BSWAP_H',
- cc.has_header_symbol('machine/bswap.h', 'bswap32',
- prefix: '''#include <sys/endian.h>
- #include <sys/types.h>'''))
config_host_data.set('CONFIG_PRCTL_PR_SET_TIMERSLACK',
cc.has_header_symbol('sys/prctl.h', 'PR_SET_TIMERSLACK'))
config_host_data.set('CONFIG_RTNETLINK',
diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h
index 32d5cdec27..3cbe52246b 100644
--- a/include/qemu/bswap.h
+++ b/include/qemu/bswap.h
@@ -1,27 +1,16 @@
#ifndef BSWAP_H
#define BSWAP_H
-#ifdef CONFIG_MACHINE_BSWAP_H
-# include <sys/endian.h>
-# include <machine/bswap.h>
-# else
-#define BSWAP_FROM_FALLBACKS
-#endif /* ! CONFIG_MACHINE_BSWAP_H */
-
#ifdef __cplusplus
extern "C" {
#endif
-#ifdef BSWAP_FROM_FALLBACKS
#undef bswap16
#define bswap16(_x) __builtin_bswap16(_x)
#undef bswap32
#define bswap32(_x) __builtin_bswap32(_x)
#undef bswap64
#define bswap64(_x) __builtin_bswap64(_x)
-#endif
-
-#undef BSWAP_FROM_FALLBACKS
static inline void bswap16s(uint16_t *s)
{
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 15/27] MAINTAINERS: Abort HAXM maintenance
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (13 preceding siblings ...)
2023-01-31 10:11 ` [PULL 14/27] qemu/bswap: Use compiler __builtin_bswap() on NetBSD Thomas Huth
@ 2023-01-31 10:11 ` Thomas Huth
2023-01-31 10:11 ` [PULL 16/27] docs/about/deprecated: Mark HAXM in QEMU as deprecated Thomas Huth
` (12 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:11 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Wenchao Wang, Hang Yuan
From: Wenchao Wang <wenchao.wang@intel.com>
Abort the maintenance of Guest CPU Cores (HAXM).
* Clean up the maintainer list of X86 HAXM CPUs
* Remove the web page URL and the mailing list
* Change the status to Orphan
Reviewed-by: Hang Yuan <hang.yuan@intel.com>
Signed-off-by: Wenchao Wang <wenchao.wang@intel.com>
Message-Id: <DM6PR11MB40903B55C23D5140E5BEF17687C49@DM6PR11MB4090.namprd11.prod.outlook.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
MAINTAINERS | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index c581c11a64..307a9d5d4c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -500,10 +500,7 @@ F: stubs/xen-hw-stub.c
Guest CPU Cores (HAXM)
---------------------
X86 HAXM CPUs
-M: Wenchao Wang <wenchao.wang@intel.com>
-L: haxm-team@intel.com
-W: https://github.com/intel/haxm/issues
-S: Maintained
+S: Orphan
F: accel/stubs/hax-stub.c
F: include/sysemu/hax.h
F: target/i386/hax/
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 16/27] docs/about/deprecated: Mark HAXM in QEMU as deprecated
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (14 preceding siblings ...)
2023-01-31 10:11 ` [PULL 15/27] MAINTAINERS: Abort HAXM maintenance Thomas Huth
@ 2023-01-31 10:11 ` Thomas Huth
2023-01-31 10:11 ` [PULL 17/27] tests/tcg: Do not build/run TCG tests if TCG is disabled Thomas Huth
` (11 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:11 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Daniel P . Berrangé
The HAXM project has been retired (see https://github.com/intel/haxm#status),
so we should mark the code in QEMU as deprecated (and finally remove it
unless somebody else picks the project up again - which is quite unlikely
since there are now whpx and hvf on these operating systems, too).
Message-Id: <20230126121034.1035138-1-thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
docs/about/deprecated.rst | 6 ++++++
target/i386/hax/hax-all.c | 3 +++
2 files changed, 9 insertions(+)
diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index 3f4d678eb4..da2e6fe63d 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -93,6 +93,12 @@ form is preferred.
The HPET setting has been turned into a machine property.
Use ``-machine hpet=off`` instead.
+``-accel hax`` (since 8.0)
+''''''''''''''''''''''''''
+
+The HAXM project has been retired (see https://github.com/intel/haxm#status).
+Use "whpx" (on Windows) or "hvf" (on macOS) instead.
+
QEMU Machine Protocol (QMP) commands
------------------------------------
diff --git a/target/i386/hax/hax-all.c b/target/i386/hax/hax-all.c
index b7fb5385b2..3e5992a63b 100644
--- a/target/i386/hax/hax-all.c
+++ b/target/i386/hax/hax-all.c
@@ -357,6 +357,9 @@ static int hax_accel_init(MachineState *ms)
fprintf(stdout, "HAX is %s and emulator runs in %s mode.\n",
!ret ? "working" : "not working",
!ret ? "fast virt" : "emulation");
+ fprintf(stdout,
+ "NOTE: HAX is deprecated and will be removed in a future release.\n"
+ " Use 'whpx' (on Windows) or 'hvf' (on macOS) instead.\n");
}
return ret;
}
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 17/27] tests/tcg: Do not build/run TCG tests if TCG is disabled
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (15 preceding siblings ...)
2023-01-31 10:11 ` [PULL 16/27] docs/about/deprecated: Mark HAXM in QEMU as deprecated Thomas Huth
@ 2023-01-31 10:11 ` Thomas Huth
2023-01-31 10:11 ` [PULL 18/27] tests/qtest/vnc-display-test: Suppress build warnings on Windows Thomas Huth
` (10 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:11 UTC (permalink / raw)
To: Peter Maydell, qemu-devel
Cc: Fabiano Rosas, Richard Henderson, Philippe Mathieu-Daudé
From: Fabiano Rosas <farosas@suse.de>
The tests under tests/tcg depend on the TCG accelerator. Do not build
them if --disable-tcg was given in the configure line.
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230120184825.31626-7-farosas@suse.de>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
configure | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index 9e407ce2e3..64960c6000 100755
--- a/configure
+++ b/configure
@@ -2483,7 +2483,11 @@ for target in $target_list; do
tcg_tests_targets="$tcg_tests_targets $target"
fi
done
-echo "TCG_TESTS_TARGETS=$tcg_tests_targets" >> config-host.mak)
+
+if test "$tcg" = "enabled"; then
+ echo "TCG_TESTS_TARGETS=$tcg_tests_targets" >> config-host.mak
+fi
+)
if test "$skip_meson" = no; then
cross="config-meson.cross.new"
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 18/27] tests/qtest/vnc-display-test: Suppress build warnings on Windows
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (16 preceding siblings ...)
2023-01-31 10:11 ` [PULL 17/27] tests/tcg: Do not build/run TCG tests if TCG is disabled Thomas Huth
@ 2023-01-31 10:11 ` Thomas Huth
2023-01-31 10:11 ` [PULL 19/27] tests/qtest/vnc-display-test: Use the 'none' machine Thomas Huth
` (9 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:11 UTC (permalink / raw)
To: Peter Maydell, qemu-devel
Cc: Philippe Mathieu-Daudé, Richard Henderson,
Marc-André Lureau
From: Philippe Mathieu-Daudé <philmd@linaro.org>
While this test is skipped on Windows, we still get when building:
tests/qtest/vnc-display-test.c:22:20: warning: unused function 'on_vnc_error' [-Wunused-function]
static inline void on_vnc_error(VncConnection* self,
^
tests/qtest/vnc-display-test.c:28:20: warning: unused function 'on_vnc_auth_failure' [-Wunused-function]
static inline void on_vnc_auth_failure(VncConnection *self,
^
2 warnings generated.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230119120514.28778-2-philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qtest/vnc-display-test.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/qtest/vnc-display-test.c b/tests/qtest/vnc-display-test.c
index e2a9d682bb..fd63e3a881 100644
--- a/tests/qtest/vnc-display-test.c
+++ b/tests/qtest/vnc-display-test.c
@@ -19,6 +19,8 @@ typedef struct Test {
GMainLoop *loop;
} Test;
+#if !defined(WIN32)
+
static void on_vnc_error(VncConnection* self,
const char* msg)
{
@@ -31,6 +33,8 @@ static void on_vnc_auth_failure(VncConnection *self,
g_error("vnc-auth-failure: %s", msg);
}
+#endif
+
static bool
test_setup(Test *test)
{
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 19/27] tests/qtest/vnc-display-test: Use the 'none' machine
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (17 preceding siblings ...)
2023-01-31 10:11 ` [PULL 18/27] tests/qtest/vnc-display-test: Suppress build warnings on Windows Thomas Huth
@ 2023-01-31 10:11 ` Thomas Huth
2023-01-31 10:11 ` [PULL 20/27] tests/qtest/vnc-display-test: Disable on Darwin Thomas Huth
` (8 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:11 UTC (permalink / raw)
To: Peter Maydell, qemu-devel
Cc: Philippe Mathieu-Daudé, Richard Henderson, Fabiano Rosas,
Marc-André Lureau
From: Philippe Mathieu-Daudé <philmd@linaro.org>
If we don't specify any machine, an architecture default
might be picked. But some architectures don't provide any
default, such ARM:
$ make check-qtest-aarch64
...
19/20 qemu:qtest+qtest-aarch64 / qtest-aarch64/vnc-display-test
qemu-system-aarch64: No machine specified, and there is no default
Since we don't need any particular machine to run this VNC
test, use the 'none' machine.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230119120514.28778-3-philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qtest/vnc-display-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/qtest/vnc-display-test.c b/tests/qtest/vnc-display-test.c
index fd63e3a881..df468c7b22 100644
--- a/tests/qtest/vnc-display-test.c
+++ b/tests/qtest/vnc-display-test.c
@@ -44,7 +44,7 @@ test_setup(Test *test)
#else
int pair[2];
- test->qts = qtest_init("-vnc none -name vnc-test");
+ test->qts = qtest_init("-M none -vnc none -name vnc-test");
g_assert_cmpint(qemu_socketpair(AF_UNIX, SOCK_STREAM, 0, pair), ==, 0);
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 20/27] tests/qtest/vnc-display-test: Disable on Darwin
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (18 preceding siblings ...)
2023-01-31 10:11 ` [PULL 19/27] tests/qtest/vnc-display-test: Use the 'none' machine Thomas Huth
@ 2023-01-31 10:11 ` Thomas Huth
2023-01-31 10:11 ` [PULL 21/27] tests/qtest/boot-serial-test: Constify tests[] array Thomas Huth
` (7 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:11 UTC (permalink / raw)
To: Peter Maydell, qemu-devel
Cc: Philippe Mathieu-Daudé, Daniel P . Berrangé,
Marc-André Lureau
From: Philippe Mathieu-Daudé <philmd@linaro.org>
This test is failing in gtk-vnc on Darwin:
$ make check-qtest-aarch64
...
19/20 qemu:qtest+qtest-aarch64 / qtest-aarch64/vnc-display-test
ERROR **: 10:42:35.488: vnc-error: Unsupported auth type 17973672
While QEMU picks the sigaltstack coroutine backend, gtk-vnc uses
the ucontext coroutine backend, which might be broken on Darwin.
Disable this test (current problem being investigated in this thread:
https://lore.kernel.org/qemu-devel/Y8kw6X6keB5l53nl@redhat.com/).
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230119120514.28778-4-philmd@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qtest/vnc-display-test.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tests/qtest/vnc-display-test.c b/tests/qtest/vnc-display-test.c
index df468c7b22..e52a4326ec 100644
--- a/tests/qtest/vnc-display-test.c
+++ b/tests/qtest/vnc-display-test.c
@@ -19,7 +19,7 @@ typedef struct Test {
GMainLoop *loop;
} Test;
-#if !defined(WIN32)
+#if !defined(WIN32) && !defined(CONFIG_DARWIN)
static void on_vnc_error(VncConnection* self,
const char* msg)
@@ -41,6 +41,9 @@ test_setup(Test *test)
#ifdef WIN32
g_test_skip("Not supported on Windows yet");
return false;
+#elif defined(CONFIG_DARWIN)
+ g_test_skip("Broken on Darwin");
+ return false;
#else
int pair[2];
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 21/27] tests/qtest/boot-serial-test: Constify tests[] array
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (19 preceding siblings ...)
2023-01-31 10:11 ` [PULL 20/27] tests/qtest/vnc-display-test: Disable on Darwin Thomas Huth
@ 2023-01-31 10:11 ` Thomas Huth
2023-01-31 10:12 ` [PULL 22/27] docs/s390x/pcidevices: document pci devices on s390x Thomas Huth
` (6 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:11 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Philippe Mathieu-Daudé, Richard Henderson
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230120082341.59913-2-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qtest/boot-serial-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c
index b216519b62..3aef3a97a9 100644
--- a/tests/qtest/boot-serial-test.c
+++ b/tests/qtest/boot-serial-test.c
@@ -139,7 +139,7 @@ typedef struct testdef {
const uint8_t *bios; /* Set in case we use our own mini bios */
} testdef_t;
-static testdef_t tests[] = {
+static const testdef_t tests[] = {
{ "alpha", "clipper", "", "PCI:" },
{ "avr", "arduino-duemilanove", "", "T", sizeof(bios_avr), NULL, bios_avr },
{ "avr", "arduino-mega-2560-v3", "", "T", sizeof(bios_avr), NULL, bios_avr},
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 22/27] docs/s390x/pcidevices: document pci devices on s390x
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (20 preceding siblings ...)
2023-01-31 10:11 ` [PULL 21/27] tests/qtest/boot-serial-test: Constify tests[] array Thomas Huth
@ 2023-01-31 10:12 ` Thomas Huth
2023-01-31 10:12 ` [PULL 23/27] qapi, audio: add query-audiodev command Thomas Huth
` (5 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:12 UTC (permalink / raw)
To: Peter Maydell, qemu-devel
Cc: Sebastian Mitterle, Cédric Le Goater, Cornelia Huck
From: Sebastian Mitterle <smitterl@redhat.com>
Add some documentation about the zpci device and how
to use it with pci devices on s390x.
Used source: Cornelia Huck's blog post
https://people.redhat.com/~cohuck/2018/02/19/notes-on-pci-on-s390x.html
Signed-off-by: Sebastian Mitterle <smitterl@redhat.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-Id: <20230127123349.55294-1-smitterl@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
docs/system/s390x/pcidevices.rst | 41 ++++++++++++++++++++++++++++++++
docs/system/target-s390x.rst | 1 +
2 files changed, 42 insertions(+)
create mode 100644 docs/system/s390x/pcidevices.rst
diff --git a/docs/system/s390x/pcidevices.rst b/docs/system/s390x/pcidevices.rst
new file mode 100644
index 0000000000..628effa2f4
--- /dev/null
+++ b/docs/system/s390x/pcidevices.rst
@@ -0,0 +1,41 @@
+PCI devices on s390x
+====================
+
+PCI devices on s390x work differently than on other architectures and need to
+be configured in a slightly different way.
+
+Every PCI device is linked with an additional ``zpci`` device.
+While the ``zpci`` device will be autogenerated if not specified, it is
+recommended to specify it explicitly so that you can pass s390-specific
+PCI configuration.
+
+For example, in order to pass a PCI device ``0000:00:00.0`` through to the
+guest, you would specify::
+
+ qemu-system-s390x ... \
+ -device zpci,uid=1,fid=0,target=hostdev0,id=zpci1 \
+ -device vfio-pci,host=0000:00:00.0,id=hostdev0
+
+Here, the zpci device is joined with the PCI device via the ``target`` property.
+
+Note that we don't set bus, slot or function here for the guest as is common in
+other PCI implementations. Topology information is not available on s390x, and
+the guest will not see any of the bus, slot or function information specified
+on the command line.
+
+Instead, ``uid`` and ``fid`` determine how the device is presented to the guest
+operating system.
+
+In case of Linux, ``uid`` will be used in the ``domain`` part of the PCI
+identifier, and ``fid`` identifies the physical slot, i.e.::
+
+ qemu-system-s390x ... \
+ -device zpci,uid=7,fid=8,target=hostdev0,id=zpci1 \
+ ...
+
+will be presented in the guest as::
+
+ # lspci -v
+ 0007:00:00.0 ...
+ Physical Slot: 00000008
+ ...
diff --git a/docs/system/target-s390x.rst b/docs/system/target-s390x.rst
index c636f64113..f6f11433c7 100644
--- a/docs/system/target-s390x.rst
+++ b/docs/system/target-s390x.rst
@@ -26,6 +26,7 @@ or vfio-ap is also available.
s390x/css
s390x/3270
s390x/vfio-ccw
+ s390x/pcidevices
Architectural features
======================
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 23/27] qapi, audio: add query-audiodev command
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (21 preceding siblings ...)
2023-01-31 10:12 ` [PULL 22/27] docs/s390x/pcidevices: document pci devices on s390x Thomas Huth
@ 2023-01-31 10:12 ` Thomas Huth
2023-01-31 10:12 ` [PULL 24/27] qapi, audio: Make introspection reflect build configuration more closely Thomas Huth
` (4 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:12 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Daniel P. Berrangé
From: Daniel P. Berrangé <berrange@redhat.com>
Way back in QEMU 4.0, the -audiodev command line option was introduced
for configuring audio backends. This CLI option does not use QemuOpts
so it is not visible for introspection in 'query-command-line-options',
instead using the QAPI Audiodev type. Unfortunately there is also no
QMP command that uses the Audiodev type, so it is not introspectable
with 'query-qmp-schema' either.
This introduces a 'query-audiodev' command that simply reflects back
the list of configured -audiodev command line options. This alone is
maybe not very useful by itself, but it makes Audiodev introspectable
via 'query-qmp-schema', so that libvirt (and other upper layer tools)
can discover the available audiodevs.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
[thuth: Update for upcoming QEMU v8.0, and use QAPI_LIST_PREPEND]
Message-Id: <20230123083957.20349-2-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
qapi/audio.json | 13 +++++++++++++
audio/audio.c | 12 ++++++++++++
2 files changed, 25 insertions(+)
diff --git a/qapi/audio.json b/qapi/audio.json
index 1e0a24bdfc..c7aafa2763 100644
--- a/qapi/audio.json
+++ b/qapi/audio.json
@@ -443,3 +443,16 @@
'sndio': 'AudiodevSndioOptions',
'spice': 'AudiodevGenericOptions',
'wav': 'AudiodevWavOptions' } }
+
+##
+# @query-audiodevs:
+#
+# Returns information about audiodev configuration
+#
+# Returns: array of @Audiodev
+#
+# Since: 8.0
+#
+##
+{ 'command': 'query-audiodevs',
+ 'returns': ['Audiodev'] }
diff --git a/audio/audio.c b/audio/audio.c
index d849a94a81..6f270c07b7 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -28,8 +28,10 @@
#include "monitor/monitor.h"
#include "qemu/timer.h"
#include "qapi/error.h"
+#include "qapi/clone-visitor.h"
#include "qapi/qobject-input-visitor.h"
#include "qapi/qapi-visit-audio.h"
+#include "qapi/qapi-commands-audio.h"
#include "qemu/cutils.h"
#include "qemu/module.h"
#include "qemu/help_option.h"
@@ -2311,3 +2313,13 @@ size_t audio_rate_get_bytes(RateCtl *rate, struct audio_pcm_info *info,
return bytes;
}
+
+AudiodevList *qmp_query_audiodevs(Error **errp)
+{
+ AudiodevList *ret = NULL;
+ AudiodevListEntry *e;
+ QSIMPLEQ_FOREACH(e, &audiodevs, next) {
+ QAPI_LIST_PREPEND(ret, QAPI_CLONE(Audiodev, e->dev));
+ }
+ return ret;
+}
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 24/27] qapi, audio: Make introspection reflect build configuration more closely
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (22 preceding siblings ...)
2023-01-31 10:12 ` [PULL 23/27] qapi, audio: add query-audiodev command Thomas Huth
@ 2023-01-31 10:12 ` Thomas Huth
2023-01-31 10:12 ` [PULL 25/27] gitlab-ci.d/buildtest: Remove ppc-softmmu from the clang-system job Thomas Huth
` (3 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:12 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Daniel P. Berrangé
From: Daniel P. Berrangé <berrange@redhat.com>
Currently the -audiodev accepts any audiodev type regardless of what is
built in to QEMU. An error only occurs later at runtime when a sound
device tries to use the audio backend.
With this change QEMU will immediately reject -audiodev args that are
not compiled into the binary. The QMP schema will also be introspectable
to identify what is compiled in.
This also helps to avoid compiling code that is not required in the
binary. Note: When building the audiodevs as modules, the patch only
compiles out code for modules that we don't build at all.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
[thuth: Rebase, take sndio and dbus devices into account]
Message-Id: <20230123083957.20349-3-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
qapi/audio.json | 44 ++++++++++++++++++++++++++++++------------
audio/audio_template.h | 20 +++++++++++++++++++
audio/audio.c | 20 +++++++++++++++++++
audio/audio_legacy.c | 41 ++++++++++++++++++++++++++++++++++++++-
4 files changed, 112 insertions(+), 13 deletions(-)
diff --git a/qapi/audio.json b/qapi/audio.json
index c7aafa2763..4e54c00f51 100644
--- a/qapi/audio.json
+++ b/qapi/audio.json
@@ -408,8 +408,18 @@
# Since: 4.0
##
{ 'enum': 'AudiodevDriver',
- 'data': [ 'none', 'alsa', 'coreaudio', 'dbus', 'dsound', 'jack', 'oss', 'pa',
- 'sdl', 'sndio', 'spice', 'wav' ] }
+ 'data': [ 'none',
+ { 'name': 'alsa', 'if': 'CONFIG_AUDIO_ALSA' },
+ { 'name': 'coreaudio', 'if': 'CONFIG_AUDIO_COREAUDIO' },
+ { 'name': 'dbus', 'if': 'CONFIG_DBUS_DISPLAY' },
+ { 'name': 'dsound', 'if': 'CONFIG_AUDIO_DSOUND' },
+ { 'name': 'jack', 'if': 'CONFIG_AUDIO_JACK' },
+ { 'name': 'oss', 'if': 'CONFIG_AUDIO_OSS' },
+ { 'name': 'pa', 'if': 'CONFIG_AUDIO_PA' },
+ { 'name': 'sdl', 'if': 'CONFIG_AUDIO_SDL' },
+ { 'name': 'sndio', 'if': 'CONFIG_AUDIO_SNDIO' },
+ { 'name': 'spice', 'if': 'CONFIG_SPICE' },
+ 'wav' ] }
##
# @Audiodev:
@@ -432,16 +442,26 @@
'discriminator': 'driver',
'data': {
'none': 'AudiodevGenericOptions',
- 'alsa': 'AudiodevAlsaOptions',
- 'coreaudio': 'AudiodevCoreaudioOptions',
- 'dbus': 'AudiodevGenericOptions',
- 'dsound': 'AudiodevDsoundOptions',
- 'jack': 'AudiodevJackOptions',
- 'oss': 'AudiodevOssOptions',
- 'pa': 'AudiodevPaOptions',
- 'sdl': 'AudiodevSdlOptions',
- 'sndio': 'AudiodevSndioOptions',
- 'spice': 'AudiodevGenericOptions',
+ 'alsa': { 'type': 'AudiodevAlsaOptions',
+ 'if': 'CONFIG_AUDIO_ALSA' },
+ 'coreaudio': { 'type': 'AudiodevCoreaudioOptions',
+ 'if': 'CONFIG_AUDIO_COREAUDIO' },
+ 'dbus': { 'type': 'AudiodevGenericOptions',
+ 'if': 'CONFIG_DBUS_DISPLAY' },
+ 'dsound': { 'type': 'AudiodevDsoundOptions',
+ 'if': 'CONFIG_AUDIO_DSOUND' },
+ 'jack': { 'type': 'AudiodevJackOptions',
+ 'if': 'CONFIG_AUDIO_JACK' },
+ 'oss': { 'type': 'AudiodevOssOptions',
+ 'if': 'CONFIG_AUDIO_OSS' },
+ 'pa': { 'type': 'AudiodevPaOptions',
+ 'if': 'CONFIG_AUDIO_PA' },
+ 'sdl': { 'type': 'AudiodevSdlOptions',
+ 'if': 'CONFIG_AUDIO_SDL' },
+ 'sndio': { 'type': 'AudiodevSndioOptions',
+ 'if': 'CONFIG_AUDIO_SNDIO' },
+ 'spice': { 'type': 'AudiodevGenericOptions',
+ 'if': 'CONFIG_SPICE' },
'wav': 'AudiodevWavOptions' } }
##
diff --git a/audio/audio_template.h b/audio/audio_template.h
index 720a32e57e..42b4712acb 100644
--- a/audio/audio_template.h
+++ b/audio/audio_template.h
@@ -326,27 +326,47 @@ AudiodevPerDirectionOptions *glue(audio_get_pdo_, TYPE)(Audiodev *dev)
switch (dev->driver) {
case AUDIODEV_DRIVER_NONE:
return dev->u.none.TYPE;
+#ifdef CONFIG_AUDIO_ALSA
case AUDIODEV_DRIVER_ALSA:
return qapi_AudiodevAlsaPerDirectionOptions_base(dev->u.alsa.TYPE);
+#endif
+#ifdef CONFIG_AUDIO_COREAUDIO
case AUDIODEV_DRIVER_COREAUDIO:
return qapi_AudiodevCoreaudioPerDirectionOptions_base(
dev->u.coreaudio.TYPE);
+#endif
+#ifdef CONFIG_DBUS_DISPLAY
case AUDIODEV_DRIVER_DBUS:
return dev->u.dbus.TYPE;
+#endif
+#ifdef CONFIG_AUDIO_DSOUND
case AUDIODEV_DRIVER_DSOUND:
return dev->u.dsound.TYPE;
+#endif
+#ifdef CONFIG_AUDIO_JACK
case AUDIODEV_DRIVER_JACK:
return qapi_AudiodevJackPerDirectionOptions_base(dev->u.jack.TYPE);
+#endif
+#ifdef CONFIG_AUDIO_OSS
case AUDIODEV_DRIVER_OSS:
return qapi_AudiodevOssPerDirectionOptions_base(dev->u.oss.TYPE);
+#endif
+#ifdef CONFIG_AUDIO_PA
case AUDIODEV_DRIVER_PA:
return qapi_AudiodevPaPerDirectionOptions_base(dev->u.pa.TYPE);
+#endif
+#ifdef CONFIG_AUDIO_SDL
case AUDIODEV_DRIVER_SDL:
return qapi_AudiodevSdlPerDirectionOptions_base(dev->u.sdl.TYPE);
+#endif
+#ifdef CONFIG_AUDIO_SNDIO
case AUDIODEV_DRIVER_SNDIO:
return dev->u.sndio.TYPE;
+#endif
+#ifdef CONFIG_SPICE
case AUDIODEV_DRIVER_SPICE:
return dev->u.spice.TYPE;
+#endif
case AUDIODEV_DRIVER_WAV:
return dev->u.wav.TYPE;
diff --git a/audio/audio.c b/audio/audio.c
index 6f270c07b7..4290309d18 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -2048,16 +2048,36 @@ void audio_create_pdos(Audiodev *dev)
break
CASE(NONE, none, );
+#ifdef CONFIG_AUDIO_ALSA
CASE(ALSA, alsa, Alsa);
+#endif
+#ifdef CONFIG_AUDIO_COREAUDIO
CASE(COREAUDIO, coreaudio, Coreaudio);
+#endif
+#ifdef CONFIG_DBUS_DISPLAY
CASE(DBUS, dbus, );
+#endif
+#ifdef CONFIG_AUDIO_DSOUND
CASE(DSOUND, dsound, );
+#endif
+#ifdef CONFIG_AUDIO_JACK
CASE(JACK, jack, Jack);
+#endif
+#ifdef CONFIG_AUDIO_OSS
CASE(OSS, oss, Oss);
+#endif
+#ifdef CONFIG_AUDIO_PA
CASE(PA, pa, Pa);
+#endif
+#ifdef CONFIG_AUDIO_SDL
CASE(SDL, sdl, Sdl);
+#endif
+#ifdef CONFIG_AUDIO_SNDIO
CASE(SNDIO, sndio, );
+#endif
+#ifdef CONFIG_SPICE
CASE(SPICE, spice, );
+#endif
CASE(WAV, wav, );
case AUDIODEV_DRIVER__MAX:
diff --git a/audio/audio_legacy.c b/audio/audio_legacy.c
index 18a89ffffb..b848001ff7 100644
--- a/audio/audio_legacy.c
+++ b/audio/audio_legacy.c
@@ -90,6 +90,7 @@ static void get_fmt(const char *env, AudioFormat *dst, bool *has_dst)
}
+#if defined(CONFIG_AUDIO_ALSA) || defined(CONFIG_AUDIO_DSOUND)
static void get_millis_to_usecs(const char *env, uint32_t *dst, bool *has_dst)
{
const char *val = getenv(env);
@@ -98,15 +99,20 @@ static void get_millis_to_usecs(const char *env, uint32_t *dst, bool *has_dst)
*has_dst = true;
}
}
+#endif
+#if defined(CONFIG_AUDIO_ALSA) || defined(CONFIG_AUDIO_COREAUDIO) || \
+ defined(CONFIG_AUDIO_PA) || defined(CONFIG_AUDIO_SDL) || \
+ defined(CONFIG_AUDIO_DSOUND) || defined(CONFIG_AUDIO_OSS)
static uint32_t frames_to_usecs(uint32_t frames,
AudiodevPerDirectionOptions *pdo)
{
uint32_t freq = pdo->has_frequency ? pdo->frequency : 44100;
return (frames * 1000000 + freq / 2) / freq;
}
+#endif
-
+#ifdef CONFIG_AUDIO_COREAUDIO
static void get_frames_to_usecs(const char *env, uint32_t *dst, bool *has_dst,
AudiodevPerDirectionOptions *pdo)
{
@@ -116,14 +122,19 @@ static void get_frames_to_usecs(const char *env, uint32_t *dst, bool *has_dst,
*has_dst = true;
}
}
+#endif
+#if defined(CONFIG_AUDIO_PA) || defined(CONFIG_AUDIO_SDL) || \
+ defined(CONFIG_AUDIO_DSOUND) || defined(CONFIG_AUDIO_OSS)
static uint32_t samples_to_usecs(uint32_t samples,
AudiodevPerDirectionOptions *pdo)
{
uint32_t channels = pdo->has_channels ? pdo->channels : 2;
return frames_to_usecs(samples / channels, pdo);
}
+#endif
+#if defined(CONFIG_AUDIO_PA) || defined(CONFIG_AUDIO_SDL)
static void get_samples_to_usecs(const char *env, uint32_t *dst, bool *has_dst,
AudiodevPerDirectionOptions *pdo)
{
@@ -133,7 +144,9 @@ static void get_samples_to_usecs(const char *env, uint32_t *dst, bool *has_dst,
*has_dst = true;
}
}
+#endif
+#if defined(CONFIG_AUDIO_DSOUND) || defined(CONFIG_AUDIO_OSS)
static uint32_t bytes_to_usecs(uint32_t bytes, AudiodevPerDirectionOptions *pdo)
{
AudioFormat fmt = pdo->has_format ? pdo->format : AUDIO_FORMAT_S16;
@@ -150,8 +163,11 @@ static void get_bytes_to_usecs(const char *env, uint32_t *dst, bool *has_dst,
*has_dst = true;
}
}
+#endif
/* backend specific functions */
+
+#ifdef CONFIG_AUDIO_ALSA
/* ALSA */
static void handle_alsa_per_direction(
AudiodevAlsaPerDirectionOptions *apdo, const char *prefix)
@@ -197,7 +213,9 @@ static void handle_alsa(Audiodev *dev)
get_millis_to_usecs("QEMU_ALSA_THRESHOLD",
&aopt->threshold, &aopt->has_threshold);
}
+#endif
+#ifdef CONFIG_AUDIO_COREAUDIO
/* coreaudio */
static void handle_coreaudio(Audiodev *dev)
{
@@ -210,7 +228,9 @@ static void handle_coreaudio(Audiodev *dev)
&dev->u.coreaudio.out->buffer_count,
&dev->u.coreaudio.out->has_buffer_count);
}
+#endif
+#ifdef CONFIG_AUDIO_DSOUND
/* dsound */
static void handle_dsound(Audiodev *dev)
{
@@ -225,7 +245,9 @@ static void handle_dsound(Audiodev *dev)
&dev->u.dsound.in->has_buffer_length,
dev->u.dsound.in);
}
+#endif
+#ifdef CONFIG_AUDIO_OSS
/* OSS */
static void handle_oss_per_direction(
AudiodevOssPerDirectionOptions *opdo, const char *try_poll_env,
@@ -253,7 +275,9 @@ static void handle_oss(Audiodev *dev)
get_bool("QEMU_OSS_EXCLUSIVE", &oopt->exclusive, &oopt->has_exclusive);
get_int("QEMU_OSS_POLICY", &oopt->dsp_policy, &oopt->has_dsp_policy);
}
+#endif
+#ifdef CONFIG_AUDIO_PA
/* pulseaudio */
static void handle_pa_per_direction(
AudiodevPaPerDirectionOptions *ppdo, const char *env)
@@ -277,7 +301,9 @@ static void handle_pa(Audiodev *dev)
get_str("QEMU_PA_SERVER", &dev->u.pa.server);
}
+#endif
+#ifdef CONFIG_AUDIO_SDL
/* SDL */
static void handle_sdl(Audiodev *dev)
{
@@ -286,6 +312,7 @@ static void handle_sdl(Audiodev *dev)
&dev->u.sdl.out->has_buffer_length,
qapi_AudiodevSdlPerDirectionOptions_base(dev->u.sdl.out));
}
+#endif
/* wav */
static void handle_wav(Audiodev *dev)
@@ -345,29 +372,41 @@ static AudiodevListEntry *legacy_opt(const char *drvname)
}
switch (e->dev->driver) {
+#ifdef CONFIG_AUDIO_ALSA
case AUDIODEV_DRIVER_ALSA:
handle_alsa(e->dev);
break;
+#endif
+#ifdef CONFIG_AUDIO_COREAUDIO
case AUDIODEV_DRIVER_COREAUDIO:
handle_coreaudio(e->dev);
break;
+#endif
+#ifdef CONFIG_AUDIO_DSOUND
case AUDIODEV_DRIVER_DSOUND:
handle_dsound(e->dev);
break;
+#endif
+#ifdef CONFIG_AUDIO_OSS
case AUDIODEV_DRIVER_OSS:
handle_oss(e->dev);
break;
+#endif
+#ifdef CONFIG_AUDIO_PA
case AUDIODEV_DRIVER_PA:
handle_pa(e->dev);
break;
+#endif
+#ifdef CONFIG_AUDIO_SDL
case AUDIODEV_DRIVER_SDL:
handle_sdl(e->dev);
break;
+#endif
case AUDIODEV_DRIVER_WAV:
handle_wav(e->dev);
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 25/27] gitlab-ci.d/buildtest: Remove ppc-softmmu from the clang-system job
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (23 preceding siblings ...)
2023-01-31 10:12 ` [PULL 24/27] qapi, audio: Make introspection reflect build configuration more closely Thomas Huth
@ 2023-01-31 10:12 ` Thomas Huth
2023-01-31 10:12 ` [PULL 26/27] tests/qtest/display-vga-test: Add proper checks if a device is available Thomas Huth
` (2 subsequent siblings)
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:12 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Philippe Mathieu-Daudé
We are also compile-testing ppc64-softmmu with clang in the "tsan-build"
job, and ppc64-softmmu covers pretty much the same code as ppc-softmmu,
so we should not lose much test coverage here by removing ppc-softmmu
from the "clang-system" job.
Message-Id: <20230130104446.1286773-2-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
.gitlab-ci.d/buildtest.yml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
index f09a898c3e..406608e5fc 100644
--- a/.gitlab-ci.d/buildtest.yml
+++ b/.gitlab-ci.d/buildtest.yml
@@ -316,8 +316,7 @@ clang-system:
IMAGE: fedora
CONFIGURE_ARGS: --cc=clang --cxx=clang++
--extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
- TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
- ppc-softmmu s390x-softmmu
+ TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu s390x-softmmu
MAKE_CHECK_ARGS: check-qtest check-tcg
clang-user:
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 26/27] tests/qtest/display-vga-test: Add proper checks if a device is available
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (24 preceding siblings ...)
2023-01-31 10:12 ` [PULL 25/27] gitlab-ci.d/buildtest: Remove ppc-softmmu from the clang-system job Thomas Huth
@ 2023-01-31 10:12 ` Thomas Huth
2023-01-31 10:12 ` [PULL 27/27] gitlab-ci.d/buildtest: Merge the --without-default-* jobs Thomas Huth
2023-02-02 18:00 ` [PULL 00/27] qtest and misc patches Peter Maydell
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:12 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Richard Henderson
display-vga-test currently tries to guess the usable VGA devices
according to the target architecture that is used for the test.
This of course does not work if QEMU has been built with the
"--without-default-devices" configure switch. To fix this, use the
qtest_has_device() function for the decision instead. This way
we can also consolidate most of the test functions into one single
function (that takes a parameter with the device name now), except
for the multihead test that tries to instantiate two devices and
thus is a little bit different.
Message-Id: <20230130104446.1286773-4-thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qtest/display-vga-test.c | 65 +++++++++++++---------------------
1 file changed, 25 insertions(+), 40 deletions(-)
diff --git a/tests/qtest/display-vga-test.c b/tests/qtest/display-vga-test.c
index ace3bb28e0..75b341a9c6 100644
--- a/tests/qtest/display-vga-test.c
+++ b/tests/qtest/display-vga-test.c
@@ -8,61 +8,46 @@
*/
#include "qemu/osdep.h"
-#include "libqtest-single.h"
-
-static void pci_cirrus(void)
-{
- qtest_start("-vga none -device cirrus-vga");
- qtest_end();
-}
-
-static void pci_stdvga(void)
-{
- qtest_start("-vga none -device VGA");
- qtest_end();
-}
-
-static void pci_secondary(void)
-{
- qtest_start("-vga none -device secondary-vga");
- qtest_end();
-}
+#include "libqtest.h"
static void pci_multihead(void)
{
- qtest_start("-vga none -device VGA -device secondary-vga");
- qtest_end();
-}
+ QTestState *qts;
-static void pci_virtio_gpu(void)
-{
- qtest_start("-vga none -device virtio-gpu-pci");
- qtest_end();
+ qts = qtest_init("-vga none -device VGA -device secondary-vga");
+ qtest_quit(qts);
}
-static void pci_virtio_vga(void)
+static void test_vga(gconstpointer data)
{
- qtest_start("-vga none -device virtio-vga");
- qtest_end();
+ QTestState *qts;
+
+ qts = qtest_initf("-vga none -device %s", (const char *)data);
+ qtest_quit(qts);
}
int main(int argc, char **argv)
{
- const char *arch = qtest_get_arch();
+ static const char *devices[] = {
+ "cirrus-vga",
+ "VGA",
+ "secondary-vga",
+ "virtio-gpu-pci",
+ "virtio-vga"
+ };
g_test_init(&argc, &argv, NULL);
- if (strcmp(arch, "alpha") == 0 || strcmp(arch, "i386") == 0 ||
- strcmp(arch, "mips") == 0 || strcmp(arch, "x86_64") == 0) {
- qtest_add_func("/display/pci/cirrus", pci_cirrus);
+ for (int i = 0; i < ARRAY_SIZE(devices); i++) {
+ if (qtest_has_device(devices[i])) {
+ char *testpath = g_strdup_printf("/display/pci/%s", devices[i]);
+ qtest_add_data_func(testpath, devices[i], test_vga);
+ g_free(testpath);
+ }
}
- qtest_add_func("/display/pci/stdvga", pci_stdvga);
- qtest_add_func("/display/pci/secondary", pci_secondary);
- qtest_add_func("/display/pci/multihead", pci_multihead);
- qtest_add_func("/display/pci/virtio-gpu", pci_virtio_gpu);
- if (g_str_equal(arch, "i386") || g_str_equal(arch, "x86_64") ||
- g_str_equal(arch, "hppa") || g_str_equal(arch, "ppc64")) {
- qtest_add_func("/display/pci/virtio-vga", pci_virtio_vga);
+
+ if (qtest_has_device("secondary-vga")) {
+ qtest_add_func("/display/pci/multihead", pci_multihead);
}
return g_test_run();
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PULL 27/27] gitlab-ci.d/buildtest: Merge the --without-default-* jobs
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (25 preceding siblings ...)
2023-01-31 10:12 ` [PULL 26/27] tests/qtest/display-vga-test: Add proper checks if a device is available Thomas Huth
@ 2023-01-31 10:12 ` Thomas Huth
2023-02-02 18:00 ` [PULL 00/27] qtest and misc patches Peter Maydell
27 siblings, 0 replies; 29+ messages in thread
From: Thomas Huth @ 2023-01-31 10:12 UTC (permalink / raw)
To: Peter Maydell, qemu-devel
Cc: Alex Bennée, Fabiano Rosas, Philippe Mathieu-Daudé
Let's safe some CI minutes by merging these two jobs. We can now
also drop "--disable-capstone" since the capstone submodule has
been removed a while ago. We should rather test --disable-fdt now
to check a compilation without the "dtc" submodule (for this we
have to drop i386-softmmu from the target list unfortunately).
Additionally, the qtests with s390x and sh4 are not read for
"--without-default-devices" yet, so we can only test mips64 and
avr here now.
Message-Id: <20230130104446.1286773-5-thuth@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
.gitlab-ci.d/buildtest.yml | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
index 406608e5fc..1c35cbfa10 100644
--- a/.gitlab-ci.d/buildtest.yml
+++ b/.gitlab-ci.d/buildtest.yml
@@ -557,29 +557,22 @@ build-coroutine-sigaltstack:
MAKE_CHECK_ARGS: check-unit
# Check our reduced build configurations
-build-without-default-devices:
+build-without-defaults:
extends: .native_build_job_template
needs:
job: amd64-centos8-container
variables:
IMAGE: centos8
- CONFIGURE_ARGS: --without-default-devices --disable-user
-
-build-without-default-features:
- extends: .native_build_job_template
- needs:
- job: amd64-fedora-container
- variables:
- IMAGE: fedora
CONFIGURE_ARGS:
+ --without-default-devices
--without-default-features
- --disable-capstone
+ --disable-fdt
--disable-pie
--disable-qom-cast-debug
--disable-strip
- TARGETS: avr-softmmu i386-softmmu mips64-softmmu s390x-softmmu sh4-softmmu
+ TARGETS: avr-softmmu mips64-softmmu s390x-softmmu sh4-softmmu
sparc64-softmmu hexagon-linux-user i386-linux-user s390x-linux-user
- MAKE_CHECK_ARGS: check-unit check-qtest SPEED=slow
+ MAKE_CHECK_ARGS: check-unit check-qtest-avr check-qtest-mips64
build-libvhost-user:
extends: .base_job_template
--
2.31.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* Re: [PULL 00/27] qtest and misc patches
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
` (26 preceding siblings ...)
2023-01-31 10:12 ` [PULL 27/27] gitlab-ci.d/buildtest: Merge the --without-default-* jobs Thomas Huth
@ 2023-02-02 18:00 ` Peter Maydell
27 siblings, 0 replies; 29+ messages in thread
From: Peter Maydell @ 2023-02-02 18:00 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-devel
On Tue, 31 Jan 2023 at 10:12, Thomas Huth <thuth@redhat.com> wrote:
>
> Hi Peter!
>
> The following changes since commit 13356edb87506c148b163b8c7eb0695647d00c2a:
>
> Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging (2023-01-24 09:45:33 +0000)
>
> are available in the Git repository at:
>
> https://gitlab.com/thuth/qemu.git tags/pull-request-2023-01-31
>
> for you to fetch changes up to e030d08c2fc02743dd37e3d2e6e28fdd739590b9:
>
> gitlab-ci.d/buildtest: Merge the --without-default-* jobs (2023-01-31 09:05:26 +0100)
>
> ----------------------------------------------------------------
> * qtest improvements
> * Remove the deprecated OTP config of sifive_u
> * Add libfdt to some of our CI jobs that were still missing it
> * Use __builtin_bswap() everywhere (all compiler versions support it now)
> * Deprecate the HAXM accelerator
> * Document PCI devices handling on s390x
> * Make Audiodev introspectable
> * Improve the runtime of some CI jobs
>
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/8.0
for any user-visible changes.
-- PMM
^ permalink raw reply [flat|nested] 29+ messages in thread