1
0
mirror of https://github.com/systemd/systemd synced 2026-03-26 08:44:55 +01:00

Compare commits

..

7 Commits

Author SHA1 Message Date
Luca Boccassi
d36ddefb51
tests: some more logs to try and get info about VM spurious reboots (#40028)
https://github.com/systemd/systemd/issues/38240 keep happening, trying
to get more info
2025-12-08 14:38:42 +00:00
Daan De Meyer
1075316a4b machine: Fix hardcoded /var/lib/machines paths 2025-12-08 14:56:39 +01:00
Luca Boccassi
b169c7512c tests: run qemu with cpu_reset,guest_errors debug messages
Attempt to gather more information to debug https://github.com/systemd/systemd/issues/38240
2025-12-08 12:08:40 +00:00
Luca Boccassi
e66f6d3b23 tests: log when qemu crashed and the test is re-ran
Follow-up for 0d7f5a9ae6f5fc70c5ad23398c2b7a515e9b1982
2025-12-08 12:08:40 +00:00
Daan De Meyer
154c642e7b
Update mkosi reference and drop use of deprecated RuntimeScratch=/--runtime-scratch= (#40016) 2025-12-08 10:18:33 +01:00
Yu Watanabe
f0feff731c mkosi: RuntimeScratch=/--runtime-scratch= are deprecated
See 054d0690b0
2025-12-07 11:15:34 +09:00
Yu Watanabe
feb9e19ae4 mkosi: update mkosi commit reference to 5a476a92deca8ad54869e5d416217aa1bb137b25
* 5a476a92de Use Path.relative_to instead of Path.parts
* 03f41faf9f Update doc for mkosi ssh to mention sd v256 sshd-vsock
* e054976d18 Rewrite note on fw deps of kernel modules in manpage
* a046243a50 Add python3-pefile to fedora tools conf
* 0bab54087e Fix truthy condition
* 01c38544b2 code review
* 563dca41da code review
* 6074d14c0e code review
* 7e842db3b1 Don't discard ordering of include/exclude entries in KernelModules=
* 0047b64785 build(deps): bump github/codeql-action from 4.31.2 to 4.31.6
* f13325bc4b build(deps): bump actions/checkout from 5.0.0 to 6.0.0
* 9ac31d1795 Add zram and nfnetlink to default initrd
* 4bdb47b6da verity: copy signing certificate to /usr/lib/verity.d/
* 8865afde9e Improve manpage output using pandoc lua filter (#4005)
* a425313c58 Pass environment to systemd-sysusers invocation
* 23f09d5de7 Make Ruff check for dangling whitespace
* abeed73d13 qemu: Add missing sandbox
* a05872e523 Ssh=yes maps to Ssh=always, update the manpage
* 79489534ca Warn of mkosi's sshd lacking support in distros' SElinux policy
* 696f99da43 Manpage: Update supported output formats
* 21675c4822 Silence swtpm SHA1 signature deprecation warning
* df53510982 DOC: update Ssh= to note sd-v256+ already generates sshd-vsock
* 50ccef7926 Configure default tools tree with ToolsTree=yes
* 0b701c690d opensuse: do not install openSUSE-release for Leap >= 16.0
* 4bababf421 opensuse: fix mirror URL for Leap >= 16.0
* c43123398c config.py: add config_default_proxy_exclude()
* 07a0a2be67 installer: Only mount configured state subdirs into sandbox
* d5efbf6f8c build(deps): bump github/codeql-action from 3.30.5 to 4.31.2
* 2912ed20d5 PTY forward fixes
* 66dab75259 sandbox: Drop all capabilities that don't make sense in userns
* 8fe5df4400 Respect SYSTEMD_TINT_BACKGROUND and SYSTEMD_ADJUST_TERMINAL_TITLE
* b9d208789d log: Drop konsole hack
* 7fa6eac65c Clarify that mkosi.images is not picked up in mkosi.conf.d
* 08a0f768dd vmspawn: Support BindUser=
* c7c3eaee4e mkosi-vm: Enable universe repository for ubuntu in mkosi-vm
* 688e77f1a8 vmspawn: Use --grow-image
* c47b7fe57b arch: Switch to the newly established fastly mirror
* 7db8f2cda3 Match compressed pacman packages too
* e3b3b93c50 Prevent using Overlay=yes with Format=portable
* 83a25324b3 Make sure apt sources are installed when BaseTrees= is in the mix
* f6fa2fd6a0 test: add unit tests for parents_below() utility function
* 1eafbd8d03 Don't print newlines in stash_terminal_title()
* bbaf92b50e Don't print newline after ansi sequences
* d1b84f5fb3 Look for .sdmagic before we consider a PE binary a UKI/addon
* b4efdbf14e Treat /opt the same as /usr for the sandbox
* 71ffced0f1 Rework PACKAGE_GLOBS to be a PackageManager classmethod
* 29605c2757 Various SPDX and whitespace fixes
2025-12-07 11:15:31 +09:00
13 changed files with 174 additions and 97 deletions

View File

@ -25,7 +25,7 @@ jobs:
steps: steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: systemd/mkosi@10544812b35a668d4aac9834c78ee8166e99bc78 - uses: systemd/mkosi@5a476a92deca8ad54869e5d416217aa1bb137b25
# Freeing up disk space with rm -rf can take multiple minutes. Since we don't need the extra free space # Freeing up disk space with rm -rf can take multiple minutes. Since we don't need the extra free space
# immediately, we remove the files in the background. However, we first move them to a different location # immediately, we remove the files in the background. However, we first move them to a different location

View File

@ -38,7 +38,7 @@ jobs:
LINTER_RULES_PATH: .github/linters LINTER_RULES_PATH: .github/linters
GITHUB_ACTIONS_CONFIG_FILE: actionlint.yml GITHUB_ACTIONS_CONFIG_FILE: actionlint.yml
- uses: systemd/mkosi@10544812b35a668d4aac9834c78ee8166e99bc78 - uses: systemd/mkosi@5a476a92deca8ad54869e5d416217aa1bb137b25
- name: Check that tabs are not used in Python code - name: Check that tabs are not used in Python code
run: sh -c '! git grep -P "\\t" -- src/core/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py' run: sh -c '! git grep -P "\\t" -- src/core/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py'

View File

@ -167,7 +167,7 @@ jobs:
steps: steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: systemd/mkosi@10544812b35a668d4aac9834c78ee8166e99bc78 - uses: systemd/mkosi@5a476a92deca8ad54869e5d416217aa1bb137b25
# Freeing up disk space with rm -rf can take multiple minutes. Since we don't need the extra free space # Freeing up disk space with rm -rf can take multiple minutes. Since we don't need the extra free space
# immediately, we remove the files in the background. However, we first move them to a different location # immediately, we remove the files in the background. However, we first move them to a different location

View File

@ -1,7 +1,7 @@
# SPDX-License-Identifier: LGPL-2.1-or-later # SPDX-License-Identifier: LGPL-2.1-or-later
[Config] [Config]
MinimumVersion=commit:10544812b35a668d4aac9834c78ee8166e99bc78 MinimumVersion=commit:5a476a92deca8ad54869e5d416217aa1bb137b25
Dependencies= Dependencies=
exitrd exitrd
initrd initrd
@ -147,7 +147,6 @@ Credentials=
tty.virtual.tty1.agetty.autologin=root tty.virtual.tty1.agetty.autologin=root
tty.virtual.tty1.login.noauth=yes tty.virtual.tty1.login.noauth=yes
RuntimeBuildSources=yes RuntimeBuildSources=yes
RuntimeScratch=no
CPUs=2 CPUs=2
TPM=yes TPM=yes
VSock=yes VSock=yes

View File

@ -27,7 +27,6 @@
#include "import-common.h" #include "import-common.h"
#include "import-util.h" #include "import-util.h"
#include "json-util.h" #include "json-util.h"
#include "machine-pool.h"
#include "main-func.h" #include "main-func.h"
#include "notify-recv.h" #include "notify-recv.h"
#include "os-util.h" #include "os-util.h"
@ -820,9 +819,9 @@ static int method_import_tar_or_raw(sd_bus_message *msg, void *userdata, sd_bus_
"Local image name %s is invalid", local); "Local image name %s is invalid", local);
if (class == IMAGE_MACHINE) { if (class == IMAGE_MACHINE) {
r = setup_machine_directory(error, m->use_btrfs_subvol, m->use_btrfs_quota); r = image_setup_pool(m->runtime_scope, class, m->use_btrfs_subvol, m->use_btrfs_quota);
if (r < 0) if (r < 0)
return r; return sd_bus_error_set_errnof(error, r, "Failed to set up machine pool: %m");
} }
type = startswith(sd_bus_message_get_member(msg), "ImportTar") ? type = startswith(sd_bus_message_get_member(msg), "ImportTar") ?
@ -921,9 +920,9 @@ static int method_import_fs(sd_bus_message *msg, void *userdata, sd_bus_error *e
"Local image name %s is invalid", local); "Local image name %s is invalid", local);
if (class == IMAGE_MACHINE) { if (class == IMAGE_MACHINE) {
r = setup_machine_directory(error, m->use_btrfs_subvol, m->use_btrfs_quota); r = image_setup_pool(m->runtime_scope, class, m->use_btrfs_subvol, m->use_btrfs_quota);
if (r < 0) if (r < 0)
return r; return sd_bus_error_set_errnof(error, r, "Failed to set up machine pool: %m");
} }
r = transfer_new(m, &t); r = transfer_new(m, &t);
@ -1126,9 +1125,9 @@ static int method_pull_tar_or_raw(sd_bus_message *msg, void *userdata, sd_bus_er
"Unknown verification mode %s", verify); "Unknown verification mode %s", verify);
if (class == IMAGE_MACHINE) { if (class == IMAGE_MACHINE) {
r = setup_machine_directory(error, m->use_btrfs_subvol, m->use_btrfs_quota); r = image_setup_pool(m->runtime_scope, class, m->use_btrfs_subvol, m->use_btrfs_quota);
if (r < 0) if (r < 0)
return r; return sd_bus_error_set_errnof(error, r, "Failed to set up machine pool: %m");
} }
type = startswith(sd_bus_message_get_member(msg), "PullTar") ? type = startswith(sd_bus_message_get_member(msg), "PullTar") ?

View File

@ -14,7 +14,6 @@
#include "image-varlink.h" #include "image-varlink.h"
#include "io-util.h" #include "io-util.h"
#include "json-util.h" #include "json-util.h"
#include "machine-pool.h"
#include "machined.h" #include "machined.h"
#include "operation.h" #include "operation.h"
#include "process-util.h" #include "process-util.h"
@ -280,7 +279,11 @@ int vl_method_set_pool_limit(sd_varlink *link, sd_json_variant *parameters, sd_v
} }
/* Set up the machine directory if necessary */ /* Set up the machine directory if necessary */
r = setup_machine_directory(/* error = */ NULL, /* use_btrfs_subvol= */ true, /* use_btrfs_quota= */ true); r = image_setup_pool(
manager->runtime_scope,
IMAGE_MACHINE,
/* use_btrfs_subvol= */ true,
/* use_btrfs_quota= */ true);
if (r < 0) if (r < 0)
return r; return r;

View File

@ -6,9 +6,7 @@
#include "sd-id128.h" #include "sd-id128.h"
#include "alloc-util.h" #include "alloc-util.h"
#include "btrfs-util.h"
#include "bus-common-errors.h" #include "bus-common-errors.h"
#include "bus-get-properties.h"
#include "bus-locator.h" #include "bus-locator.h"
#include "bus-message-util.h" #include "bus-message-util.h"
#include "bus-object.h" #include "bus-object.h"
@ -27,7 +25,6 @@
#include "io-util.h" #include "io-util.h"
#include "machine.h" #include "machine.h"
#include "machine-dbus.h" #include "machine-dbus.h"
#include "machine-pool.h"
#include "machined.h" #include "machined.h"
#include "namespace-util.h" #include "namespace-util.h"
#include "operation.h" #include "operation.h"
@ -39,7 +36,25 @@
#include "unit-def.h" #include "unit-def.h"
#include "user-util.h" #include "user-util.h"
static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_pool_path, "s", "/var/lib/machines"); static int property_get_pool_path(
sd_bus *bus,
const char *path,
const char *interface,
const char *property,
sd_bus_message *reply,
void *userdata,
sd_bus_error *error) {
_cleanup_free_ char *poolpath = NULL;
Manager *m = ASSERT_PTR(userdata);
assert(bus);
assert(reply);
(void) image_get_pool_path(m->runtime_scope, IMAGE_MACHINE, &poolpath);
return sd_bus_message_append(reply, "s", strempty(poolpath));
}
static int property_get_pool_usage( static int property_get_pool_usage(
sd_bus *bus, sd_bus *bus,
@ -50,19 +65,13 @@ static int property_get_pool_usage(
void *userdata, void *userdata,
sd_bus_error *error) { sd_bus_error *error) {
_cleanup_close_ int fd = -EBADF; Manager *m = ASSERT_PTR(userdata);
uint64_t usage = UINT64_MAX; uint64_t usage = UINT64_MAX;
assert(bus); assert(bus);
assert(reply); assert(reply);
fd = open("/var/lib/machines", O_RDONLY|O_CLOEXEC|O_DIRECTORY); (void) image_get_pool_usage(m->runtime_scope, IMAGE_MACHINE, &usage);
if (fd >= 0) {
BtrfsQuotaInfo q;
if (btrfs_subvol_get_subtree_quota_fd(fd, 0, &q) >= 0)
usage = q.referenced;
}
return sd_bus_message_append(reply, "t", usage); return sd_bus_message_append(reply, "t", usage);
} }
@ -76,19 +85,13 @@ static int property_get_pool_limit(
void *userdata, void *userdata,
sd_bus_error *error) { sd_bus_error *error) {
_cleanup_close_ int fd = -EBADF; Manager *m = ASSERT_PTR(userdata);
uint64_t size = UINT64_MAX; uint64_t size = UINT64_MAX;
assert(bus); assert(bus);
assert(reply); assert(reply);
fd = open("/var/lib/machines", O_RDONLY|O_CLOEXEC|O_DIRECTORY); (void) image_get_pool_limit(m->runtime_scope, IMAGE_MACHINE, &size);
if (fd >= 0) {
BtrfsQuotaInfo q;
if (btrfs_subvol_get_subtree_quota_fd(fd, 0, &q) >= 0)
size = q.referenced_max;
}
return sd_bus_message_append(reply, "t", size); return sd_bus_message_append(reply, "t", size);
} }
@ -1077,9 +1080,13 @@ static int method_set_pool_limit(sd_bus_message *message, void *userdata, sd_bus
} }
/* Set up the machine directory if necessary */ /* Set up the machine directory if necessary */
r = setup_machine_directory(error, /* use_btrfs_subvol= */ true, /* use_btrfs_quota= */ true); r = image_setup_pool(
m->runtime_scope,
IMAGE_MACHINE,
/* use_btrfs_subvol= */ true,
/* use_btrfs_quota= */ true);
if (r < 0) if (r < 0)
return r; return sd_bus_error_set_errnof(error, r, "Failed to set up machine pool: %m");
r = image_set_pool_limit(m->runtime_scope, IMAGE_MACHINE, limit); r = image_set_pool_limit(m->runtime_scope, IMAGE_MACHINE, limit);
if (ERRNO_IS_NEG_NOT_SUPPORTED(r)) if (ERRNO_IS_NEG_NOT_SUPPORTED(r))

View File

@ -31,6 +31,7 @@
#include "hashmap.h" #include "hashmap.h"
#include "hostname-setup.h" #include "hostname-setup.h"
#include "id128-util.h" #include "id128-util.h"
#include "label-util.h"
#include "lock-util.h" #include "lock-util.h"
#include "log.h" #include "log.h"
#include "loop-util.h" #include "loop-util.h"
@ -1919,6 +1920,119 @@ int image_set_pool_limit(RuntimeScope scope, ImageClass class, uint64_t referenc
return 0; return 0;
} }
int image_get_pool_path(RuntimeScope scope, ImageClass class, char **ret) {
assert(scope >= 0 && scope < _RUNTIME_SCOPE_MAX);
assert(class >= 0 && class < _IMAGE_CLASS_MAX);
assert(ret);
return get_pool_directory(scope, class, /* fname= */ NULL, /* suffix= */ NULL, ret);
}
int image_get_pool_usage(RuntimeScope scope, ImageClass class, uint64_t *ret) {
int r;
assert(scope >= 0 && scope < _RUNTIME_SCOPE_MAX);
assert(class >= 0 && class < _IMAGE_CLASS_MAX);
assert(ret);
_cleanup_free_ char *pool = NULL;
r = get_pool_directory(scope, class, /* fname= */ NULL, /* suffix= */ NULL, &pool);
if (r < 0)
return r;
_cleanup_close_ int fd = open(pool, O_RDONLY|O_CLOEXEC|O_DIRECTORY);
if (fd < 0)
return -errno;
BtrfsQuotaInfo q;
r = btrfs_subvol_get_subtree_quota_fd(fd, /* subvol_id= */ 0, &q);
if (r < 0)
return r;
*ret = q.referenced;
return 0;
}
int image_get_pool_limit(RuntimeScope scope, ImageClass class, uint64_t *ret) {
int r;
assert(scope >= 0 && scope < _RUNTIME_SCOPE_MAX);
assert(class >= 0 && class < _IMAGE_CLASS_MAX);
assert(ret);
_cleanup_free_ char *pool = NULL;
r = get_pool_directory(scope, class, /* fname= */ NULL, /* suffix= */ NULL, &pool);
if (r < 0)
return r;
_cleanup_close_ int fd = open(pool, O_RDONLY|O_CLOEXEC|O_DIRECTORY);
if (fd < 0)
return -errno;
BtrfsQuotaInfo q;
r = btrfs_subvol_get_subtree_quota_fd(fd, /* subvol_id= */ 0, &q);
if (r < 0)
return r;
*ret = q.referenced_max;
return 0;
}
static int check_btrfs(const char *path) {
struct statfs sfs;
int r;
if (statfs(path, &sfs) < 0) {
if (errno != ENOENT)
return -errno;
_cleanup_free_ char *parent = NULL;
r = path_extract_directory(path, &parent);
if (r < 0)
return r;
if (statfs(parent, &sfs) < 0)
return -errno;
}
return F_TYPE_EQUAL(sfs.f_type, BTRFS_SUPER_MAGIC);
}
int image_setup_pool(RuntimeScope scope, ImageClass class, bool use_btrfs_subvol, bool use_btrfs_quota) {
int r;
assert(class >= 0 && class < _IMAGE_CLASS_MAX);
_cleanup_free_ char *pool = NULL;
r = image_get_pool_path(scope, class, &pool);
if (r < 0)
return r;
r = check_btrfs(pool);
if (r < 0)
return r;
if (r == 0)
return 0;
if (!use_btrfs_subvol)
return 0;
(void) btrfs_subvol_make_label(pool);
if (!use_btrfs_quota)
return 0;
r = btrfs_quota_enable(pool, /* b= */ true);
if (r < 0)
log_warning_errno(r, "Failed to enable quota for %s, ignoring: %m", pool);
r = btrfs_subvol_auto_qgroup(pool, /* subvol_id= */ 0, /* create_intermediary_qgroup= */ true);
if (r < 0)
log_warning_errno(r, "Failed to set up default quota hierarchy for %s, ignoring: %m", pool);
return 0;
}
int image_read_metadata(Image *i, const ImagePolicy *image_policy, RuntimeScope scope) { int image_read_metadata(Image *i, const ImagePolicy *image_policy, RuntimeScope scope) {
_cleanup_(release_lock_file) LockFile global_lock = LOCK_FILE_INIT, local_lock = LOCK_FILE_INIT; _cleanup_(release_lock_file) LockFile global_lock = LOCK_FILE_INIT, local_lock = LOCK_FILE_INIT;
int r; int r;

View File

@ -69,6 +69,10 @@ int image_name_lock(RuntimeScope scope, const char *name, int operation, LockFil
int image_set_limit(Image *i, uint64_t referenced_max); int image_set_limit(Image *i, uint64_t referenced_max);
int image_set_pool_limit(RuntimeScope scope, ImageClass class, uint64_t referenced_max); int image_set_pool_limit(RuntimeScope scope, ImageClass class, uint64_t referenced_max);
int image_get_pool_path(RuntimeScope scope, ImageClass class, char **ret);
int image_get_pool_usage(RuntimeScope scope, ImageClass class, uint64_t *ret);
int image_get_pool_limit(RuntimeScope scope, ImageClass class, uint64_t *ret);
int image_setup_pool(RuntimeScope scope, ImageClass class, bool use_btrfs_subvol, bool use_btrfs_quota);
int image_read_metadata(Image *i, const ImagePolicy *image_policy, RuntimeScope scope); int image_read_metadata(Image *i, const ImagePolicy *image_policy, RuntimeScope scope);

View File

@ -1,53 +0,0 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/magic.h>
#include "sd-bus.h"
#include "btrfs-util.h"
#include "label-util.h"
#include "log.h"
#include "machine-pool.h"
#include "stat-util.h"
static int check_btrfs(void) {
struct statfs sfs;
if (statfs("/var/lib/machines", &sfs) < 0) {
if (errno != ENOENT)
return -errno;
if (statfs("/var/lib", &sfs) < 0)
return -errno;
}
return F_TYPE_EQUAL(sfs.f_type, BTRFS_SUPER_MAGIC);
}
int setup_machine_directory(sd_bus_error *error, bool use_btrfs_subvol, bool use_btrfs_quota) {
int r;
r = check_btrfs();
if (r < 0)
return sd_bus_error_set_errnof(error, r, "Failed to determine whether /var/lib/machines is located on btrfs: %m");
if (r == 0)
return 0;
if (!use_btrfs_subvol)
return 0;
(void) btrfs_subvol_make_label("/var/lib/machines");
if (!use_btrfs_quota)
return 0;
r = btrfs_quota_enable("/var/lib/machines", true);
if (r < 0)
log_warning_errno(r, "Failed to enable quota for /var/lib/machines, ignoring: %m");
r = btrfs_subvol_auto_qgroup("/var/lib/machines", 0, true);
if (r < 0)
log_warning_errno(r, "Failed to set up default quota hierarchy for /var/lib/machines, ignoring: %m");
return 0;
}

View File

@ -1,6 +0,0 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "shared-forward.h"
int setup_machine_directory(sd_bus_error *error, bool use_btrfs_subvol, bool use_btrfs_quota);

View File

@ -125,7 +125,6 @@ shared_sources = files(
'machine-bind-user.c', 'machine-bind-user.c',
'machine-credential.c', 'machine-credential.c',
'machine-id-setup.c', 'machine-id-setup.c',
'machine-pool.c',
'macvlan-util.c', 'macvlan-util.c',
'main-func.c', 'main-func.c',
'mkdir-label.c', 'mkdir-label.c',

View File

@ -584,7 +584,6 @@ def main() -> None:
), ),
'--credential', f'systemd.unit-dropin.{args.unit}={shlex.quote(dropin)}', '--credential', f'systemd.unit-dropin.{args.unit}={shlex.quote(dropin)}',
'--runtime-network=none', '--runtime-network=none',
'--runtime-scratch=no',
*([f'--qemu-args=-rtc base={rtc}'] if rtc else []), *([f'--qemu-args=-rtc base={rtc}'] if rtc else []),
*args.mkosi_args, *args.mkosi_args,
'--firmware', firmware, '--firmware', firmware,
@ -616,6 +615,10 @@ def main() -> None:
*(['--', '--capability=CAP_BPF'] if not vm else []), *(['--', '--capability=CAP_BPF'] if not vm else []),
] # fmt: skip ] # fmt: skip
# XXX: debug for https://github.com/systemd/systemd/issues/38240
if vm:
cmd += ['--qemu-args=-d cpu_reset,guest_errors -D /dev/stderr']
try: try:
result = subprocess.run(cmd) result = subprocess.run(cmd)
@ -623,6 +626,10 @@ def main() -> None:
if args.vm and result.returncode == 247 and args.exit_code != 247: if args.vm and result.returncode == 247 and args.exit_code != 247:
if journal_file: if journal_file:
journal_file.unlink(missing_ok=True) journal_file.unlink(missing_ok=True)
print(
f'Test {args.name} failed due to QEMU crash (error 247), retrying...',
file=sys.stderr,
)
result = subprocess.run(cmd) result = subprocess.run(cmd)
if args.vm and result.returncode == 247 and args.exit_code != 247: if args.vm and result.returncode == 247 and args.exit_code != 247:
print( print(
@ -630,6 +637,10 @@ def main() -> None:
file=sys.stderr, file=sys.stderr,
) )
exit(77) exit(77)
print(
f'Test {args.name} worked on re-run after QEMU crash (error 247)',
file=sys.stderr,
)
except KeyboardInterrupt: except KeyboardInterrupt:
result = subprocess.CompletedProcess(args=cmd, returncode=-signal.SIGINT) result = subprocess.CompletedProcess(args=cmd, returncode=-signal.SIGINT)