aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.d/buildtest.yml4
-rw-r--r--.readthedocs.yml19
-rw-r--r--chardev/char-fe.c16
-rw-r--r--chardev/char.c2
-rw-r--r--docs/requirements.txt2
-rw-r--r--include/chardev/char-fe.h19
-rw-r--r--scripts/mtest2make.py3
-rw-r--r--tests/avocado/kvm_xen_guest.py2
-rw-r--r--tests/avocado/machine_microblaze.py26
-rw-r--r--tests/avocado/replay_kernel.py3
-rw-r--r--tests/fp/meson.build2
-rw-r--r--tests/qtest/meson.build25
-rw-r--r--tests/unit/meson.build2
13 files changed, 85 insertions, 40 deletions
diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
index 9b4df24..e1c7801 100644
--- a/.gitlab-ci.d/buildtest.yml
+++ b/.gitlab-ci.d/buildtest.yml
@@ -41,7 +41,7 @@ build-system-ubuntu:
variables:
IMAGE: ubuntu2204
CONFIGURE_ARGS: --enable-docs
- TARGETS: alpha-softmmu microblaze-softmmu mips64el-softmmu
+ TARGETS: alpha-softmmu microblazeel-softmmu mips64el-softmmu
MAKE_CHECK_ARGS: check-build
check-system-ubuntu:
@@ -61,7 +61,7 @@ avocado-system-ubuntu:
variables:
IMAGE: ubuntu2204
MAKE_CHECK_ARGS: check-avocado
- AVOCADO_TAGS: arch:alpha arch:microblaze arch:mips64el
+ AVOCADO_TAGS: arch:alpha arch:microblazeel arch:mips64el
build-system-debian:
extends:
diff --git a/.readthedocs.yml b/.readthedocs.yml
index 7fb7b8d..0b26246 100644
--- a/.readthedocs.yml
+++ b/.readthedocs.yml
@@ -5,16 +5,21 @@
# Required
version: 2
+# Set the version of Python and other tools you might need
+build:
+ os: ubuntu-22.04
+ tools:
+ python: "3.11"
+
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
+# We recommend specifying your dependencies to enable reproducible builds:
+# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
+python:
+ install:
+ - requirements: docs/requirements.txt
+
# We want all the document formats
formats: all
-
-# For consistency, we require that QEMU's Sphinx extensions
-# run with at least the same minimum version of Python that
-# we require for other Python in our codebase (our conf.py
-# enforces this, and some code needs it.)
-python:
- version: 3.6
diff --git a/chardev/char-fe.c b/chardev/char-fe.c
index 7789f7b..20222a4 100644
--- a/chardev/char-fe.c
+++ b/chardev/char-fe.c
@@ -211,7 +211,7 @@ bool qemu_chr_fe_init(CharBackend *b, Chardev *s, Error **errp)
}
}
- b->fe_open = false;
+ b->fe_is_open = false;
b->tag = tag;
b->chr = s;
return true;
@@ -257,7 +257,7 @@ void qemu_chr_fe_set_handlers_full(CharBackend *b,
bool sync_state)
{
Chardev *s;
- int fe_open;
+ bool fe_open;
s = b->chr;
if (!s) {
@@ -265,10 +265,10 @@ void qemu_chr_fe_set_handlers_full(CharBackend *b,
}
if (!opaque && !fd_can_read && !fd_read && !fd_event) {
- fe_open = 0;
+ fe_open = false;
remove_fd_in_watch(s);
} else {
- fe_open = 1;
+ fe_open = true;
}
b->chr_can_read = fd_can_read;
b->chr_read = fd_read;
@@ -336,7 +336,7 @@ void qemu_chr_fe_set_echo(CharBackend *be, bool echo)
}
}
-void qemu_chr_fe_set_open(CharBackend *be, int fe_open)
+void qemu_chr_fe_set_open(CharBackend *be, bool is_open)
{
Chardev *chr = be->chr;
@@ -344,12 +344,12 @@ void qemu_chr_fe_set_open(CharBackend *be, int fe_open)
return;
}
- if (be->fe_open == fe_open) {
+ if (be->fe_is_open == is_open) {
return;
}
- be->fe_open = fe_open;
+ be->fe_is_open = is_open;
if (CHARDEV_GET_CLASS(chr)->chr_set_fe_open) {
- CHARDEV_GET_CLASS(chr)->chr_set_fe_open(chr, fe_open);
+ CHARDEV_GET_CLASS(chr)->chr_set_fe_open(chr, is_open);
}
}
diff --git a/chardev/char.c b/chardev/char.c
index 185b5ea..3c43fb1 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -762,7 +762,7 @@ static int qmp_query_chardev_foreach(Object *obj, void *data)
value->label = g_strdup(chr->label);
value->filename = g_strdup(chr->filename);
- value->frontend_open = chr->be && chr->be->fe_open;
+ value->frontend_open = chr->be && chr->be->fe_is_open;
QAPI_LIST_PREPEND(*list, value);
diff --git a/docs/requirements.txt b/docs/requirements.txt
new file mode 100644
index 0000000..691e521
--- /dev/null
+++ b/docs/requirements.txt
@@ -0,0 +1,2 @@
+sphinx==5.3.0
+sphinx_rtd_theme==1.1.1
diff --git a/include/chardev/char-fe.h b/include/chardev/char-fe.h
index 0ff6f87..ecef182 100644
--- a/include/chardev/char-fe.h
+++ b/include/chardev/char-fe.h
@@ -7,8 +7,12 @@
typedef void IOEventHandler(void *opaque, QEMUChrEvent event);
typedef int BackendChangeHandler(void *opaque);
-/* This is the backend as seen by frontend, the actual backend is
- * Chardev */
+/**
+ * struct CharBackend - back end as seen by front end
+ * @fe_is_open: the front end is ready for IO
+ *
+ * The actual backend is Chardev
+ */
struct CharBackend {
Chardev *chr;
IOEventHandler *chr_event;
@@ -17,7 +21,7 @@ struct CharBackend {
BackendChangeHandler *chr_be_change;
void *opaque;
int tag;
- int fe_open;
+ bool fe_is_open;
};
/**
@@ -156,12 +160,13 @@ void qemu_chr_fe_set_echo(CharBackend *be, bool echo);
/**
* qemu_chr_fe_set_open:
+ * @be: a CharBackend
+ * @is_open: the front end open status
*
- * Set character frontend open status. This is an indication that the
- * front end is ready (or not) to begin doing I/O.
- * Without associated Chardev, do nothing.
+ * This is an indication that the front end is ready (or not) to begin
+ * doing I/O. Without associated Chardev, do nothing.
*/
-void qemu_chr_fe_set_open(CharBackend *be, int fe_open);
+void qemu_chr_fe_set_open(CharBackend *be, bool is_open);
/**
* qemu_chr_fe_printf:
diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py
index 179dd54..eb01a05 100644
--- a/scripts/mtest2make.py
+++ b/scripts/mtest2make.py
@@ -27,7 +27,8 @@ SPEED = quick
.speed.slow = $(foreach s,$(sort $(filter-out %-thorough, $1)), --suite $s)
.speed.thorough = $(foreach s,$(sort $1), --suite $s)
-.mtestargs = --no-rebuild -t 0
+TIMEOUT_MULTIPLIER = 1
+.mtestargs = --no-rebuild -t $(TIMEOUT_MULTIPLIER)
ifneq ($(SPEED), quick)
.mtestargs += --setup $(SPEED)
endif
diff --git a/tests/avocado/kvm_xen_guest.py b/tests/avocado/kvm_xen_guest.py
index 5391283..f8cb458 100644
--- a/tests/avocado/kvm_xen_guest.py
+++ b/tests/avocado/kvm_xen_guest.py
@@ -59,7 +59,7 @@ class KVMXenGuest(QemuSystemTest, LinuxSSHMixIn):
def run_and_check(self):
self.vm.add_args('-kernel', self.kernel_path,
'-append', self.kernel_params,
- '-drive', f"file={self.rootfs},if=none,format=raw,id=drv0",
+ '-drive', f"file={self.rootfs},if=none,snapshot=on,format=raw,id=drv0",
'-device', 'xen-disk,drive=drv0,vdev=xvda',
'-device', 'virtio-net-pci,netdev=unet',
'-netdev', 'user,id=unet,hostfwd=:127.0.0.1:0-:22')
diff --git a/tests/avocado/machine_microblaze.py b/tests/avocado/machine_microblaze.py
index 8d0efff..807709c 100644
--- a/tests/avocado/machine_microblaze.py
+++ b/tests/avocado/machine_microblaze.py
@@ -5,6 +5,8 @@
# This work is licensed under the terms of the GNU GPL, version 2 or
# later. See the COPYING file in the top-level directory.
+import time
+from avocado_qemu import exec_command, exec_command_and_wait_for_pattern
from avocado_qemu import QemuSystemTest
from avocado_qemu import wait_for_console_pattern
from avocado.utils import archive
@@ -33,3 +35,27 @@ class MicroblazeMachine(QemuSystemTest):
# The kernel sometimes gets stuck after the "This architecture ..."
# message, that's why we don't test for a later string here. This
# needs some investigation by a microblaze wizard one day...
+
+ def test_microblazeel_s3adsp1800(self):
+ """
+ :avocado: tags=arch:microblazeel
+ :avocado: tags=machine:petalogix-s3adsp1800
+ """
+
+ self.require_netdev('user')
+ tar_url = ('http://www.qemu-advent-calendar.org/2023/download/'
+ 'day13.tar.gz')
+ tar_hash = '6623d5fff5f84cfa8f34e286f32eff6a26546f44'
+ file_path = self.fetch_asset(tar_url, asset_hash=tar_hash)
+ archive.extract(file_path, self.workdir)
+ self.vm.set_console()
+ self.vm.add_args('-kernel', self.workdir + '/day13/xmaton.bin')
+ self.vm.add_args('-nic', 'user,tftp=' + self.workdir + '/day13/')
+ self.vm.launch()
+ wait_for_console_pattern(self, 'QEMU Advent Calendar 2023')
+ time.sleep(0.1)
+ exec_command(self, 'root')
+ time.sleep(0.1)
+ exec_command_and_wait_for_pattern(self,
+ 'tftp -g -r xmaton.png 10.0.2.2 ; md5sum xmaton.png',
+ '821cd3cab8efd16ad6ee5acc3642a8ea')
diff --git a/tests/avocado/replay_kernel.py b/tests/avocado/replay_kernel.py
index 6fdcbd6..10d9940 100644
--- a/tests/avocado/replay_kernel.py
+++ b/tests/avocado/replay_kernel.py
@@ -98,10 +98,13 @@ class ReplayKernelNormal(ReplayKernelBase):
self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5)
+ # See https://gitlab.com/qemu-project/qemu/-/issues/2094
+ @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test sometimes gets stuck')
def test_x86_64_pc(self):
"""
:avocado: tags=arch:x86_64
:avocado: tags=machine:pc
+ :avocado: tags=flaky
"""
kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
'/linux/releases/29/Everything/x86_64/os/images/pxeboot'
diff --git a/tests/fp/meson.build b/tests/fp/meson.build
index 4ab89aa..114b4b4 100644
--- a/tests/fp/meson.build
+++ b/tests/fp/meson.build
@@ -124,7 +124,7 @@ test('fp-test-mulAdd', fptest,
# no fptest_rounding_args
args: fptest_args +
['f16_mulAdd', 'f32_mulAdd', 'f64_mulAdd', 'f128_mulAdd'],
- suite: ['softfloat-slow', 'softfloat-ops-slow', 'slow'], timeout: 90)
+ suite: ['softfloat-slow', 'softfloat-ops-slow', 'slow'], timeout: 180)
executable(
'fp-bench',
diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index f25bffc..fd40136 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -1,14 +1,15 @@
slow_qtests = {
- 'ahci-test' : 60,
- 'bios-tables-test' : 120,
- 'boot-serial-test' : 60,
- 'migration-test' : 150,
- 'npcm7xx_pwm-test': 150,
- 'prom-env-test' : 60,
- 'pxe-test' : 60,
- 'qos-test' : 60,
- 'qom-test' : 300,
- 'test-hmp' : 120,
+ 'aspeed_smc-test': 360,
+ 'bios-tables-test' : 540,
+ 'device-introspect-test' : 720,
+ 'migration-test' : 480,
+ 'npcm7xx_pwm-test': 300,
+ 'qom-test' : 900,
+ 'test-hmp' : 240,
+ 'pxe-test': 600,
+ 'prom-env-test': 360,
+ 'boot-serial-test': 180,
+ 'qos-test': 120,
}
qtests_generic = [
@@ -383,8 +384,8 @@ foreach dir : target_dirs
env: qtest_env,
args: ['--tap', '-k'],
protocol: 'tap',
- timeout: slow_qtests.get(test, 30),
- priority: slow_qtests.get(test, 30),
+ timeout: slow_qtests.get(test, 60),
+ priority: slow_qtests.get(test, 60),
suite: ['qtest', 'qtest-' + target_base])
endforeach
endforeach
diff --git a/tests/unit/meson.build b/tests/unit/meson.build
index 69f9c05..0659532 100644
--- a/tests/unit/meson.build
+++ b/tests/unit/meson.build
@@ -172,6 +172,8 @@ test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
slow_tests = {
+ 'test-aio-multithread' : 120,
+ 'test-crypto-block' : 300,
'test-crypto-tlscredsx509': 45,
'test-crypto-tlssession': 45
}