testing and plugin updates for 7.2:

- cleanup win32/64 docker files
   - update test-mingw test
   - add flex/bison to debian-all-test
   - handle --enable-static/--disable-pie in config
   - extend timeouts on x86_64 avocado tests
   - add flex/bison to debian-hexagon-cross
   - use regular semihosting for nios2 check-tcg
   - fix obscure linker error to nios2 softmmu tests
   - various windows portability fixes for tests
   - clean-up of MAINTAINERS
   - use -machine none when appropriate in avocado
   - make raspi2_initrd test detect shutdown
   - disable sh4 rd2 tests on gitlab
   - re-enable threadcount/linux-test for sh4
   - clean-up s390x handling of "ex" instruction
   - better handle new CPUs in execlog plugin
   - pass CONFIG_DEBUG_TCG to plugin builds
   - try and avoid races in test-io-channel-command
   - speed up ssh key checking for tests/vm
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEZoWumedRZ7yvyN81+9DbCVqeKkQFAmNhI/MACgkQ+9DbCVqe
 KkSFXggAg0HIpBDcNz0V5Mh5p69F14pwbDSygKqGDFBebdOHeL7f+WCvQPUGEWxp
 814zjvRY3SC4Mo4mtzguRvNu0styaUpemvRw5FDYK48GpEjg2eVxTnAFD4nr7ud0
 dhw3iaHP+RjA6s3EpPUqQ5nlZEgFJ+Tvkckk3wKSpksBYA4tJra6Uey5kpZ27x0T
 KOzB2P6w+9B/B11n/aeSxvRPZdnXt2MyfS/3pwwfoFYioEyaEQ3Ie6ooachtdSL3
 PEvnJVK0VVYbZQwBXJlycNLlK/D++s4AEwmnZ5GmvDFuXlkRO9YMy9Wa5TKJl7gz
 76Aw1KHsE03SyAPvH4bE7eGkIwhJOQ==
 =6hXE
 -----END PGP SIGNATURE-----

Merge tag 'pull-testing-for-7.2-011122-3' of https://github.com/stsquad/qemu into staging

testing and plugin updates for 7.2:

  - cleanup win32/64 docker files
  - update test-mingw test
  - add flex/bison to debian-all-test
  - handle --enable-static/--disable-pie in config
  - extend timeouts on x86_64 avocado tests
  - add flex/bison to debian-hexagon-cross
  - use regular semihosting for nios2 check-tcg
  - fix obscure linker error to nios2 softmmu tests
  - various windows portability fixes for tests
  - clean-up of MAINTAINERS
  - use -machine none when appropriate in avocado
  - make raspi2_initrd test detect shutdown
  - disable sh4 rd2 tests on gitlab
  - re-enable threadcount/linux-test for sh4
  - clean-up s390x handling of "ex" instruction
  - better handle new CPUs in execlog plugin
  - pass CONFIG_DEBUG_TCG to plugin builds
  - try and avoid races in test-io-channel-command
  - speed up ssh key checking for tests/vm

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCgAdFiEEZoWumedRZ7yvyN81+9DbCVqeKkQFAmNhI/MACgkQ+9DbCVqe
# KkSFXggAg0HIpBDcNz0V5Mh5p69F14pwbDSygKqGDFBebdOHeL7f+WCvQPUGEWxp
# 814zjvRY3SC4Mo4mtzguRvNu0styaUpemvRw5FDYK48GpEjg2eVxTnAFD4nr7ud0
# dhw3iaHP+RjA6s3EpPUqQ5nlZEgFJ+Tvkckk3wKSpksBYA4tJra6Uey5kpZ27x0T
# KOzB2P6w+9B/B11n/aeSxvRPZdnXt2MyfS/3pwwfoFYioEyaEQ3Ie6ooachtdSL3
# PEvnJVK0VVYbZQwBXJlycNLlK/D++s4AEwmnZ5GmvDFuXlkRO9YMy9Wa5TKJl7gz
# 76Aw1KHsE03SyAPvH4bE7eGkIwhJOQ==
# =6hXE
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 01 Nov 2022 09:49:39 EDT
# gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
# gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44

* tag 'pull-testing-for-7.2-011122-3' of https://github.com/stsquad/qemu: (31 commits)
  tests/vm: use -o IdentitiesOnly=yes for ssh
  tests/unit: cleanups for test-io-channel-command
  contrib/plugins: protect execlog's last_exec expansion
  contrib/plugins: enable debug on CONFIG_DEBUG_TCG
  tests/tcg: include CONFIG_PLUGIN in config-host.mak
  target/s390x: fake instruction loading when handling 'ex'
  target/s390x: don't probe next pc for EXecuted insns
  target/s390x: don't use ld_code2 to probe next pc
  tests/tcg: re-enable threadcount for sh4
  tests/tcg: re-enable linux-test for sh4
  tests/avocado: disable sh4 rd2 tests on Gitlab
  tests/avocado: raspi2_initrd: Wait for guest shutdown message before stopping
  tests/avocado: set -machine none for userfwd and vnc tests
  MAINTAINERS: fix-up for check-tcg Makefile changes
  MAINTAINERS: add features_to_c.sh to gdbstub files
  MAINTAINERS: add entries for the key build bits
  hw/usb: dev-mtp: Use g_mkdir()
  block/vvfat: Unify the mkdir() call
  tcg: Avoid using hardcoded /tmp
  semihosting/arm-compat-semi: Avoid using hardcoded /tmp
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Stefan Hajnoczi 2022-11-01 13:39:05 -04:00
commit 0d37413c63
26 changed files with 396 additions and 175 deletions

View File

@ -547,12 +547,14 @@ F: */*win32*
F: include/*/*win32*
X: qga/*win32*
F: qemu.nsi
F: scripts/nsis.py
Darwin (macOS, iOS)
M: Philippe Mathieu-Daudé <philmd@linaro.org>
S: Odd Fixes
F: .gitlab-ci.d/cirrus/macos-*
F: */*.m
F: scripts/entitlement.sh
Alpha Machines
--------------
@ -2687,6 +2689,7 @@ F: gdbstub/*
F: include/exec/gdbstub.h
F: gdb-xml/
F: tests/tcg/multiarch/gdbstub/
F: scripts/feature_to_c.sh
Memory API
M: Paolo Bonzini <pbonzini@redhat.com>
@ -3726,8 +3729,7 @@ Guest Test Compilation Support
M: Alex Bennée <alex.bennee@linaro.org>
R: Philippe Mathieu-Daudé <philmd@linaro.org>
S: Maintained
F: tests/tcg/Makefile
F: tests/tcg/Makefile.include
F: tests/tcg/Makefile.target
Integration Testing with the Avocado framework
W: https://trello.com/b/6Qi1pxVn/avocado-qemu
@ -3764,6 +3766,29 @@ F: docs/about/deprecated.rst
Build System
------------
Meson
M: Paolo Bonzini <pbonzini@redhat.com>
R: Marc-André Lureau <marcandre.lureau@redhat.com>
R: Daniel P. Berrange <berrange@redhat.com>
R: Thomas Huth <thuth@redhat.com>
R: Philippe Mathieu-Daudé <philmd@linaro.org>
S: Maintained
F: meson.build
F: meson_options.txt
F: scripts/meson-buildoptions.*
F: scripts/check_sparse.py
F: scripts/symlink-install-tree.py
Top Level Makefile and configure
M: Paolo Bonzini <pbonzini@redhat.com>
R: Alex Bennée <alex.bennee@linaro.org>
R: Thomas Huth <thuth@redhat.com>
S: Maintained
F: Makefile
F: configure
F: scripts/mtest2make.py
F: tests/Makefile.include
GIT submodules
M: Daniel P. Berrange <berrange@redhat.com>
S: Odd Fixes

View File

@ -25,6 +25,7 @@
#include "qemu/osdep.h"
#include <dirent.h>
#include <glib/gstdio.h>
#include "qapi/error.h"
#include "block/block_int.h"
#include "block/qdict.h"
@ -2726,13 +2727,9 @@ static int handle_renames_and_mkdirs(BDRVVVFATState* s)
mapping_t* mapping;
int j, parent_path_len;
#ifdef __MINGW32__
if (mkdir(commit->path))
if (g_mkdir(commit->path, 0755)) {
return -5;
#else
if (mkdir(commit->path, 0755))
return -5;
#endif
}
mapping = insert_mapping(s, commit->param.mkdir.cluster,
commit->param.mkdir.cluster + 1);

17
configure vendored
View File

@ -1327,6 +1327,8 @@ static THREAD int tls_var;
int main(void) { return tls_var; }
EOF
# Meson currently only handles pie as a boolean for now so if we have
# explicitly disabled PIE we need to extend our cflags because it wont.
if test "$static" = "yes"; then
if test "$pie" != "no" && compile_prog "-Werror -fPIE -DPIE" "-static-pie"; then
CONFIGURE_CFLAGS="-fPIE -DPIE $CONFIGURE_CFLAGS"
@ -1335,13 +1337,12 @@ if test "$static" = "yes"; then
error_exit "-static-pie not available due to missing toolchain support"
else
pie="no"
QEMU_CFLAGS="-fno-pie -no-pie $QEMU_CFLAGS"
fi
elif test "$pie" = "no"; then
if compile_prog "-Werror -fno-pie" "-no-pie"; then
CONFIGURE_CFLAGS="-fno-pie $CONFIGURE_CFLAGS"
CONFIGURE_LDFLAGS="-no-pie $CONFIGURE_LDFLAGS"
# Meson currently only handles pie as a boolean for now so if we have
# explicitly disabled PIE we need to extend our cflags because it wont.
QEMU_CFLAGS="-fno-pie -no-pie $QEMU_CFLAGS"
fi
elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then
@ -1877,6 +1878,15 @@ probe_target_compiler() {
container_cross_ranlib=
container_cross_strip=
# We shall skip configuring the target compiler if the user didn't
# bother enabling an appropriate guest. This avoids building
# extraneous firmware images and tests.
if test "${target_list#*$1}" != "$1"; then
break;
else
return 1
fi
target_arch=${1%%-*}
case $target_arch in
aarch64) container_hosts="x86_64 aarch64" ;;
@ -2476,6 +2486,9 @@ echo "HOST_CC=$host_cc" >> $config_host_mak
if test -n "$gdb_bin"; then
echo "HAVE_GDB_BIN=$gdb_bin" >> $config_host_mak
fi
if test "$plugins" = "yes" ; then
echo "CONFIG_PLUGIN=y" >> $config_host_mak
fi
tcg_tests_targets=
for target in $target_list; do

View File

@ -29,6 +29,7 @@ SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES)))
CFLAGS = $(GLIB_CFLAGS)
CFLAGS += -fPIC -Wall $(filter -W%, $(QEMU_CFLAGS))
CFLAGS += $(if $(findstring no-psabi,$(QEMU_CFLAGS)),-Wpsabi)
CFLAGS += $(if $(CONFIG_DEBUG_TCG), -ggdb -O0)
CFLAGS += -I$(SRC_PATH)/include/qemu
all: $(SONAMES)

View File

@ -18,11 +18,30 @@
QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION;
/* Store last executed instruction on each vCPU as a GString */
GArray *last_exec;
static GPtrArray *last_exec;
static GMutex expand_array_lock;
static GPtrArray *imatches;
static GArray *amatches;
/*
* Expand last_exec array.
*
* As we could have multiple threads trying to do this we need to
* serialise the expansion under a lock. Threads accessing already
* created entries can continue without issue even if the ptr array
* gets reallocated during resize.
*/
static void expand_last_exec(int cpu_index)
{
g_mutex_lock(&expand_array_lock);
while (cpu_index >= last_exec->len) {
GString *s = g_string_new(NULL);
g_ptr_array_add(last_exec, s);
}
g_mutex_unlock(&expand_array_lock);
}
/**
* Add memory read or write information to current instruction log
*/
@ -33,7 +52,7 @@ static void vcpu_mem(unsigned int cpu_index, qemu_plugin_meminfo_t info,
/* Find vCPU in array */
g_assert(cpu_index < last_exec->len);
s = g_array_index(last_exec, GString *, cpu_index);
s = g_ptr_array_index(last_exec, cpu_index);
/* Indicate type of memory access */
if (qemu_plugin_mem_is_store(info)) {
@ -61,11 +80,10 @@ static void vcpu_insn_exec(unsigned int cpu_index, void *udata)
GString *s;
/* Find or create vCPU in array */
while (cpu_index >= last_exec->len) {
s = g_string_new(NULL);
g_array_append_val(last_exec, s);
if (cpu_index >= last_exec->len) {
expand_last_exec(cpu_index);
}
s = g_array_index(last_exec, GString *, cpu_index);
s = g_ptr_array_index(last_exec, cpu_index);
/* Print previous instruction in cache */
if (s->len) {
@ -163,7 +181,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
guint i;
GString *s;
for (i = 0; i < last_exec->len; i++) {
s = g_array_index(last_exec, GString *, i);
s = g_ptr_array_index(last_exec, i);
if (s->str) {
qemu_plugin_outs(s->str);
qemu_plugin_outs("\n");
@ -201,7 +219,11 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id,
* Initialize dynamic array to cache vCPU instruction. In user mode
* we don't know the size before emulation.
*/
last_exec = g_array_new(FALSE, FALSE, sizeof(GString *));
if (info->system_emulation) {
last_exec = g_ptr_array_sized_new(info->system.max_vcpus);
} else {
last_exec = g_ptr_array_new();
}
for (int i = 0; i < argc; i++) {
char *opt = argv[i];

View File

@ -14,7 +14,7 @@
#include "qemu/error-report.h"
#include <wchar.h>
#include <dirent.h>
#include <glib/gstdio.h>
#include <sys/statvfs.h>
@ -1622,7 +1622,7 @@ static void usb_mtp_write_data(MTPState *s, uint32_t handle)
if (s->dataset.filename) {
path = g_strdup_printf("%s/%s", parent->path, s->dataset.filename);
if (s->dataset.format == FMT_ASSOCIATION) {
ret = mkdir(path, mask);
ret = g_mkdir(path, mask);
if (!ret) {
usb_mtp_queue_result(s, RES_OK, d->trans, 3,
QEMU_STORAGE_ID,

View File

@ -211,6 +211,23 @@ translator_ldq_swap(CPUArchState *env, DisasContextBase *db,
return ret;
}
/**
* translator_fake_ldb - fake instruction load
* @insn8: byte of instruction
* @pc: program counter of instruction
*
* This is a special case helper used where the instruction we are
* about to translate comes from somewhere else (e.g. being
* re-synthesised for s390x "ex"). It ensures we update other areas of
* the translator with details of the executed instruction.
*/
static inline void translator_fake_ldb(uint8_t insn8, abi_ptr pc)
{
plugin_insn_append(pc, &insn8, sizeof(insn8));
}
/*
* Return whether addr is on the same page as where disassembly started.
* Translators can use this to enforce the rule that only single-insn

View File

@ -503,7 +503,8 @@ void do_common_semihosting(CPUState *cs)
GET_ARG(0);
GET_ARG(1);
GET_ARG(2);
len = asprintf(&s, "/tmp/qemu-%x%02x", getpid(), (int)arg1 & 0xff);
len = asprintf(&s, "%s/qemu-%x%02x", g_get_tmp_dir(),
getpid(), (int)arg1 & 0xff);
if (len < 0) {
common_semi_set_ret(cs, -1);
break;

View File

@ -6317,12 +6317,18 @@ static const DisasInsn *extract_insn(CPUS390XState *env, DisasContext *s)
if (unlikely(s->ex_value)) {
/* Drop the EX data now, so that it's clear on exception paths. */
TCGv_i64 zero = tcg_const_i64(0);
int i;
tcg_gen_st_i64(zero, cpu_env, offsetof(CPUS390XState, ex_value));
tcg_temp_free_i64(zero);
/* Extract the values saved by EXECUTE. */
insn = s->ex_value & 0xffffffffffff0000ull;
ilen = s->ex_value & 0xf;
/* register insn bytes with translator so plugins work */
for (i = 0; i < ilen; i++) {
uint8_t byte = extract64(insn, 56 - (i * 8), 8);
translator_fake_ldb(byte, pc + i);
}
op = insn >> 56;
} else {
insn = ld_code2(env, s, pc);
@ -6612,7 +6618,7 @@ static void s390x_tr_insn_start(DisasContextBase *dcbase, CPUState *cs)
static target_ulong get_next_pc(CPUS390XState *env, DisasContext *s,
uint64_t pc)
{
uint64_t insn = ld_code2(env, s, pc);
uint64_t insn = cpu_lduw_code(env, pc);
return pc + get_ilen((insn >> 8) & 0xff);
}
@ -6624,9 +6630,9 @@ static void s390x_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
dc->base.is_jmp = translate_one(env, dc);
if (dc->base.is_jmp == DISAS_NEXT) {
if (!is_same_page(dcbase, dc->base.pc_next) ||
!is_same_page(dcbase, get_next_pc(env, dc, dc->base.pc_next)) ||
dc->ex_value) {
if (dc->ex_value ||
!is_same_page(dcbase, dc->base.pc_next) ||
!is_same_page(dcbase, get_next_pc(env, dc, dc->base.pc_next))) {
dc->base.is_jmp = DISAS_TOO_MANY;
}
}

View File

@ -4658,7 +4658,8 @@ static void tcg_register_jit_int(const void *buf_ptr, size_t buf_size,
/* Enable this block to be able to debug the ELF image file creation.
One can use readelf, objdump, or other inspection utilities. */
{
FILE *f = fopen("/tmp/qemu.jit", "w+b");
g_autofree char *jit = g_strdup_printf("%s/qemu.jit", g_get_tmp_dir());
FILE *f = fopen(jit, "w+b");
if (f) {
if (fwrite(img, img_size, 1, f) != img_size) {
/* Avoid stupid unused return value warning for fwrite. */

View File

@ -19,6 +19,7 @@ class BootLinuxX8664(LinuxTest):
"""
:avocado: tags=arch:x86_64
"""
timeout = 480
def test_pc_i440fx_tcg(self):
"""

View File

@ -15,6 +15,7 @@ import shutil
from avocado import skip
from avocado import skipUnless
from avocado import skipIf
from avocado_qemu import QemuSystemTest
from avocado_qemu import exec_command
from avocado_qemu import exec_command_and_wait_for_pattern
@ -489,7 +490,7 @@ class BootLinuxConsole(LinuxKernelTest):
'BCM2835')
exec_command_and_wait_for_pattern(self, 'cat /proc/iomem',
'/soc/cprman@7e101000')
exec_command(self, 'halt')
exec_command_and_wait_for_pattern(self, 'halt', 'reboot: System halted')
# Wait for VM to shut down gracefully
self.vm.wait()
@ -1175,6 +1176,10 @@ class BootLinuxConsole(LinuxKernelTest):
self.vm.add_args('-M', 'graphics=off')
self.do_test_advcal_2018('15', tar_hash, 'invaders.elf')
# This test has a 6-10% failure rate on various hosts that look
# like issues with a buggy kernel. As a result we don't want it
# gating releases on Gitlab.
@skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
def test_sh4_r2d(self):
"""
:avocado: tags=arch:sh4

View File

@ -14,6 +14,9 @@ from qemu.utils import get_info_usernet_hostfwd_port
class InfoUsernet(QemuSystemTest):
"""
:avocado: tags=machine:none
"""
def test_hostfwd(self):
self.require_netdev('user')

View File

@ -53,6 +53,7 @@ def find_free_ports(count: int) -> List[int]:
class Vnc(QemuSystemTest):
"""
:avocado: tags=vnc,quick
:avocado: tags=machine:none
"""
def test_no_vnc(self):
self.vm.add_args('-nodefaults', '-S')

View File

@ -20,8 +20,10 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
# Add extra build tools and as many cross compilers as we can for testing
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
bison \
ccache \
clang \
flex \
git \
ninja-build \
gcc-aarch64-linux-gnu \

View File

@ -43,7 +43,7 @@ RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.lis
# Install QEMU build deps for use in CI
RUN apt update && \
DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
DEBIAN_FRONTEND=noninteractive eatmydata apt install -yy git ninja-build && \
DEBIAN_FRONTEND=noninteractive eatmydata apt install -yy bison flex git ninja-build && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt build-dep -yy --arch-only qemu
COPY --from=0 /usr/local /usr/local

View File

@ -1,46 +1,103 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool dockerfile --layers all --cross mingw32 fedora-35 qemu
#
# https://gitlab.com/libvirt/libvirt-ci
FROM registry.fedoraproject.org/fedora:35
# Please keep this list sorted alphabetically
ENV PACKAGES \
bc \
bison \
bzip2 \
ccache \
diffutils \
findutils \
flex \
gcc \
gettext \
git \
glib2-devel \
hostname \
make \
meson \
mingw32-bzip2 \
mingw32-curl \
mingw32-glib2 \
mingw32-gmp \
mingw32-gnutls \
mingw32-gtk3 \
mingw32-libffi \
mingw32-libjpeg-turbo \
mingw32-libpng \
mingw32-libtasn1 \
mingw32-libusbx \
mingw32-nettle \
mingw32-nsis \
mingw32-pixman \
mingw32-pkg-config \
mingw32-SDL2 \
msitools \
perl \
python3 \
python3-PyYAML \
tar \
which
RUN dnf install -y nosync && \
echo -e '#!/bin/sh\n\
if test -d /usr/lib64\n\
then\n\
export LD_PRELOAD=/usr/lib64/nosync/nosync.so\n\
else\n\
export LD_PRELOAD=/usr/lib/nosync/nosync.so\n\
fi\n\
exec "$@"' > /usr/bin/nosync && \
chmod +x /usr/bin/nosync && \
nosync dnf update -y && \
nosync dnf install -y \
bash \
bc \
bison \
bzip2 \
ca-certificates \
ccache \
ctags \
dbus-daemon \
diffutils \
findutils \
flex \
gcovr \
genisoimage \
git \
glib2-devel \
glibc-langpack-en \
hostname \
llvm \
make \
meson \
ninja-build \
nmap-ncat \
openssh-clients \
pcre-static \
perl-base \
python3 \
python3-PyYAML \
python3-numpy \
python3-opencv \
python3-pillow \
python3-pip \
python3-sphinx \
python3-sphinx_rtd_theme \
rpm \
sed \
sparse \
spice-protocol \
tar \
tesseract \
tesseract-langpack-eng \
texinfo \
util-linux \
which && \
nosync dnf autoremove -y && \
nosync dnf clean all -y
RUN dnf install -y $PACKAGES
RUN rpm -q $PACKAGES | sort > /packages.txt
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3"
# Specify the cross prefix for this image (see tests/docker/common.rc)
RUN nosync dnf install -y \
mingw32-SDL2 \
mingw32-SDL2_image \
mingw32-bzip2 \
mingw32-curl \
mingw32-gcc \
mingw32-gcc-c++ \
mingw32-gettext \
mingw32-glib2 \
mingw32-gnutls \
mingw32-gtk3 \
mingw32-libgcrypt \
mingw32-libjpeg-turbo \
mingw32-libpng \
mingw32-libtasn1 \
mingw32-nettle \
mingw32-nsis \
mingw32-pixman \
mingw32-pkg-config && \
nosync dnf clean all -y && \
rpm -qa | sort > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/i686-w64-mingw32-c++ && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/i686-w64-mingw32-cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/i686-w64-mingw32-g++ && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/i686-w64-mingw32-gcc
ENV ABI "i686-w64-mingw32"
ENV MESON_OPTS "--cross-file=/usr/share/mingw/toolchain-mingw32.meson"
ENV QEMU_CONFIGURE_OPTS --cross-prefix=i686-w64-mingw32-
ENV DEF_TARGET_LIST i386-softmmu

View File

@ -1,43 +1,103 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool dockerfile --layers all --cross mingw64 fedora-35 qemu
#
# https://gitlab.com/libvirt/libvirt-ci
FROM registry.fedoraproject.org/fedora:35
# Please keep this list sorted alphabetically
ENV PACKAGES \
bc \
bison \
bzip2 \
ccache \
diffutils \
findutils \
flex \
gcc \
gettext \
git \
glib2-devel \
hostname \
make \
meson \
mingw32-nsis \
mingw64-bzip2 \
mingw64-curl \
mingw64-glib2 \
mingw64-gmp \
mingw64-gtk3 \
mingw64-libffi \
mingw64-libjpeg-turbo \
mingw64-libpng \
mingw64-libtasn1 \
mingw64-libusbx \
mingw64-pixman \
mingw64-pkg-config \
msitools \
perl \
python3 \
python3-PyYAML \
tar \
which
RUN dnf install -y nosync && \
echo -e '#!/bin/sh\n\
if test -d /usr/lib64\n\
then\n\
export LD_PRELOAD=/usr/lib64/nosync/nosync.so\n\
else\n\
export LD_PRELOAD=/usr/lib/nosync/nosync.so\n\
fi\n\
exec "$@"' > /usr/bin/nosync && \
chmod +x /usr/bin/nosync && \
nosync dnf update -y && \
nosync dnf install -y \
bash \
bc \
bison \
bzip2 \
ca-certificates \
ccache \
ctags \
dbus-daemon \
diffutils \
findutils \
flex \
gcovr \
genisoimage \
git \
glib2-devel \
glibc-langpack-en \
hostname \
llvm \
make \
meson \
ninja-build \
nmap-ncat \
openssh-clients \
pcre-static \
perl-base \
python3 \
python3-PyYAML \
python3-numpy \
python3-opencv \
python3-pillow \
python3-pip \
python3-sphinx \
python3-sphinx_rtd_theme \
rpm \
sed \
sparse \
spice-protocol \
tar \
tesseract \
tesseract-langpack-eng \
texinfo \
util-linux \
which && \
nosync dnf autoremove -y && \
nosync dnf clean all -y
RUN dnf install -y $PACKAGES
RUN rpm -q $PACKAGES | sort > /packages.txt
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3"
# Specify the cross prefix for this image (see tests/docker/common.rc)
ENV QEMU_CONFIGURE_OPTS --cross-prefix=x86_64-w64-mingw32- --disable-capstone
RUN nosync dnf install -y \
mingw32-nsis \
mingw64-SDL2 \
mingw64-SDL2_image \
mingw64-bzip2 \
mingw64-curl \
mingw64-gcc \
mingw64-gcc-c++ \
mingw64-gettext \
mingw64-glib2 \
mingw64-gnutls \
mingw64-gtk3 \
mingw64-libgcrypt \
mingw64-libjpeg-turbo \
mingw64-libpng \
mingw64-libtasn1 \
mingw64-nettle \
mingw64-pixman \
mingw64-pkg-config && \
nosync dnf clean all -y && \
rpm -qa | sort > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/x86_64-w64-mingw32-c++ && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/x86_64-w64-mingw32-cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/x86_64-w64-mingw32-g++ && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/x86_64-w64-mingw32-gcc
ENV ABI "x86_64-w64-mingw32"
ENV MESON_OPTS "--cross-file=/usr/share/mingw/toolchain-mingw64.meson"
ENV QEMU_CONFIGURE_OPTS --cross-prefix=x86_64-w64-mingw32-
ENV DEF_TARGET_LIST x86_64-softmmu

View File

@ -13,14 +13,12 @@
. common.rc
requires_binary x86_64-w64-mingw32-gcc
requires_binary i686-w64-mingw32-gcc
requires_binary x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc
cd "$BUILD_DIR"
for prefix in x86_64-w64-mingw32- i686-w64-mingw32-; do
TARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \
build_qemu --cross-prefix=$prefix \
TARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \
build_qemu \
--enable-trace-backends=simple \
--enable-gnutls \
--enable-nettle \
@ -29,8 +27,6 @@ for prefix in x86_64-w64-mingw32- i686-w64-mingw32-; do
--enable-bzip2 \
--enable-guest-agent \
--enable-docs
install_qemu
make installer
make clean
done
install_qemu
make installer
make clean

@ -1 +1 @@
Subproject commit 79691a50a5f99bd7adda236f66c3c09371b01afa
Subproject commit d40e203631eb3eacee17e8cf8fd20aa5152db62a

View File

@ -93,7 +93,7 @@ debian11_extras = [
]
def debian_cross_build(prefix, targets):
def cross_build(prefix, targets):
conf = "ENV QEMU_CONFIGURE_OPTS --cross-prefix=%s\n" % (prefix)
targets = "ENV DEF_TARGET_LIST %s\n" % (targets)
return "".join([conf, targets])
@ -121,45 +121,55 @@ try:
#
generate_dockerfile("debian-amd64-cross", "debian-11",
cross="x86_64",
trailer=debian_cross_build("x86_64-linux-gnu-",
"x86_64-softmmu,"
"x86_64-linux-user,"
"i386-softmmu,i386-linux-user"))
trailer=cross_build("x86_64-linux-gnu-",
"x86_64-softmmu,"
"x86_64-linux-user,"
"i386-softmmu,i386-linux-user"))
generate_dockerfile("debian-arm64-cross", "debian-11",
cross="aarch64",
trailer=debian_cross_build("aarch64-linux-gnu-",
"aarch64-softmmu,aarch64-linux-user"))
trailer=cross_build("aarch64-linux-gnu-",
"aarch64-softmmu,aarch64-linux-user"))
generate_dockerfile("debian-armel-cross", "debian-11",
cross="armv6l",
trailer=debian_cross_build("arm-linux-gnueabi-",
"arm-softmmu,arm-linux-user,armeb-linux-user"))
trailer=cross_build("arm-linux-gnueabi-",
"arm-softmmu,arm-linux-user,armeb-linux-user"))
generate_dockerfile("debian-armhf-cross", "debian-11",
cross="armv7l",
trailer=debian_cross_build("arm-linux-gnueabihf-",
"arm-softmmu,arm-linux-user"))
trailer=cross_build("arm-linux-gnueabihf-",
"arm-softmmu,arm-linux-user"))
generate_dockerfile("debian-mips64el-cross", "debian-11",
cross="mips64el",
trailer=debian_cross_build("mips64el-linux-gnuabi64-",
"mips64el-softmmu,mips64el-linux-user"))
trailer=cross_build("mips64el-linux-gnuabi64-",
"mips64el-softmmu,mips64el-linux-user"))
generate_dockerfile("debian-mipsel-cross", "debian-11",
cross="mipsel",
trailer=debian_cross_build("mipsel-linux-gnu-",
"mipsel-softmmu,mipsel-linux-user"))
trailer=cross_build("mipsel-linux-gnu-",
"mipsel-softmmu,mipsel-linux-user"))
generate_dockerfile("debian-ppc64el-cross", "debian-11",
cross="ppc64le",
trailer=debian_cross_build("powerpc64le-linux-gnu-",
"ppc64-softmmu,ppc64-linux-user"))
trailer=cross_build("powerpc64le-linux-gnu-",
"ppc64-softmmu,ppc64-linux-user"))
generate_dockerfile("debian-s390x-cross", "debian-11",
cross="s390x",
trailer=debian_cross_build("s390x-linux-gnu-",
"s390x-softmmu,s390x-linux-user"))
trailer=cross_build("s390x-linux-gnu-",
"s390x-softmmu,s390x-linux-user"))
generate_dockerfile("fedora-win32-cross", "fedora-35",
cross="mingw32",
trailer=cross_build("i686-w64-mingw32-",
"i386-softmmu"))
generate_dockerfile("fedora-win64-cross", "fedora-35",
cross="mingw64",
trailer=cross_build("x86_64-w64-mingw32-",
"x86_64-softmmu"))
#
# Cirrus packages lists for GitLab

View File

@ -44,11 +44,15 @@ SECTIONS
.data : ALIGN(4) {
*(.shdata)
*(.data .data.* .gnu.linkonce.d.*)
. = ALIGN(4);
_gp = ABSOLUTE(. + 0x8000);
*(.got.plt) *(.got)
*(.lit8)
*(.lit4)
} >ram :RAM
HIDDEN (_gp = ALIGN(16) + 0x7ff0);
PROVIDE_HIDDEN (gp = _gp);
.got : ALIGN(4) {
*(.got.plt) *(.igot.plt) *(.got) *(.igot)
} >ram :RAM
.sdata : ALIGN(4) {
*(.sdata .sdata.* .gnu.linkonce.s.*)
} >ram :RAM

View File

@ -25,8 +25,7 @@ LDFLAGS += -Wl,-T$(LINK_SCRIPT) -static -nostdlib $(CRT_OBJS) -lgcc
%: %.o $(LINK_SCRIPT) $(CRT_OBJS)
$(call quiet-command, $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS), LD, $@)
# FIXME: nios2 semihosting writes to stdout, not a chardev
QEMU_OPTS = -M 10m50-ghrd,vic=on -semihosting >$@.out -kernel
QEMU_OPTS = -M 10m50-ghrd,vic=on -semihosting-config enable=on,target=native,chardev=output -kernel
memory: CFLAGS+=-DCHECK_UNALIGNED=0
TESTS += $(MULTIARCH_TESTS)

View File

@ -12,15 +12,3 @@ run-signals: signals
$(call skip-test, $<, "BROKEN")
run-plugin-signals-with-%:
$(call skip-test, $<, "BROKEN")
# This test is currently broken: https://gitlab.com/qemu-project/qemu/-/issues/704
run-linux-test: linux-test
$(call skip-test, $<, "BROKEN")
run-plugin-linux-test-with-%:
$(call skip-test, $<, "BROKEN")
# This test is currently unreliable: https://gitlab.com/qemu-project/qemu/-/issues/856
run-threadcount:
$(call skip-test, $<, "BROKEN")
run-plugin-threadcount-with-%:
$(call skip-test, $<, "BROKEN")

View File

@ -19,6 +19,7 @@
*/
#include "qemu/osdep.h"
#include <glib/gstdio.h>
#include "io/channel-command.h"
#include "io-channel-helpers.h"
#include "qapi/error.h"
@ -26,32 +27,32 @@
#define TEST_FIFO "test-io-channel-command.fifo"
#define SOCAT_SRC "PIPE:" TEST_FIFO ",wronly"
#define SOCAT_DST "PIPE:" TEST_FIFO ",rdonly"
static char *socat = NULL;
static void test_io_channel_command_fifo(bool async)
{
g_autofree gchar *tmpdir = g_dir_make_tmp("qemu-test-io-channel.XXXXXX", NULL);
g_autofree gchar *fifo = g_strdup_printf("%s/%s", tmpdir, TEST_FIFO);
g_autoptr(GString) srcargs = g_string_new(socat);
g_autoptr(GString) dstargs = g_string_new(socat);
g_auto(GStrv) srcargv;
g_auto(GStrv) dstargv;
QIOChannel *src, *dst;
QIOChannelTest *test;
const char *srcargv[] = {
socat, "-", SOCAT_SRC, NULL,
};
const char *dstargv[] = {
socat, SOCAT_DST, "-", NULL,
};
if (!socat) {
g_test_skip("socat is not found in PATH");
return;
}
g_string_append_printf(srcargs, " - PIPE:%s,wronly", fifo);
g_string_append_printf(dstargs, " PIPE:%s,rdonly -", fifo);
unlink(TEST_FIFO);
src = QIO_CHANNEL(qio_channel_command_new_spawn(srcargv,
srcargv = g_strsplit(srcargs->str, " ", -1);
dstargv = g_strsplit(dstargs->str, " ", -1);
src = QIO_CHANNEL(qio_channel_command_new_spawn((const char **) srcargv,
O_WRONLY,
&error_abort));
dst = QIO_CHANNEL(qio_channel_command_new_spawn(dstargv,
/* try to avoid a race to create the socket */
g_usleep(1000);
dst = QIO_CHANNEL(qio_channel_command_new_spawn((const char **) dstargv,
O_RDONLY,
&error_abort));
@ -62,17 +63,27 @@ static void test_io_channel_command_fifo(bool async)
object_unref(OBJECT(src));
object_unref(OBJECT(dst));
unlink(TEST_FIFO);
g_rmdir(tmpdir);
}
static void test_io_channel_command_fifo_async(void)
{
if (!socat) {
g_test_skip("socat is not found in PATH");
return;
}
test_io_channel_command_fifo(true);
}
static void test_io_channel_command_fifo_sync(void)
{
if (!socat) {
g_test_skip("socat is not found in PATH");
return;
}
test_io_channel_command_fifo(false);
}

View File

@ -233,7 +233,8 @@ class BaseVM(object):
"-o", "UserKnownHostsFile=" + os.devnull,
"-o",
"ConnectTimeout={}".format(self._config["ssh_timeout"]),
"-p", str(self.ssh_port), "-i", self._ssh_tmp_key_file]
"-p", str(self.ssh_port), "-i", self._ssh_tmp_key_file,
"-o", "IdentitiesOnly=yes"]
# If not in debug mode, set ssh to quiet mode to
# avoid printing the results of commands.
if not self.debug: