Add a libvirt/KVM test environment and fix the gcc-12 warning it found
The VM harness (tests/vm/) builds and exercises the tools on real Debian and Alpine guests, driving the serial console (no sshd/cloud-init dependency). Results on Debian 12 (glibc 2.36, gcc 12.2): 12/12 checks pass, 0 warnings with -Wall -Wextra, including a real 128M -> 256M resize and the rollback save/restore/reject paths. Results on Alpine 3.20 (musl 1.2.5): the build cannot start. configure stops at "reiserfsprogs requires a method to add printf modifiers" because reiserfscore/prints.c depends on glibc's register_printf_specifier(3) and <printf.h>, which musl does not provide. This is pre-existing and out of scope here; measured at 341 use sites across 20+ files, all routed through reiserfs_warning()/reiserfs_info(). Documented in tests/vm/RESULTS.md. Fix the one real defect the harness surfaced: fsck/semantic_check.c: check_check_regular_file() is called with NULL for new_ih (line 466), so the block that would fill *new_ih is unreachable and check_semantic_pass() never returns RELOCATED through that path. The "case RELOCATED:" arm still reads relocated_ih.ih_key, which gcc 12.2 reports as "may be used uninitialized" (-Wmaybe-uninitialized); gcc 16 does not, because it proves the path dead. Zero-initialise the struct and say why. Verified: 0 warnings on gcc 12.2 after the change, and the Debian battery stays at 12/12.
This commit is contained in:
1 parent
293e6a7280
commit
5a7382185b
8 files changed
+628
-1
No files matched your search
@@ -551,7 +551,10 @@ static int check_semantic_pass(struct reiserfs_key *key,
|
||||
|
||||
for (i = pos_in_item; i < get_ih_entry_count(&tmp_ih);
|
||||
i++, deh++) {
|
||||
struct item_head relocated_ih;
|
||||
/* Only meaningful when check_check_regular_file() returns
|
||||
RELOCATED; that path currently passes NULL for new_ih,
|
||||
so this stays zero-initialised. */
|
||||
struct item_head relocated_ih = { 0 };
|
||||
int ret = OK;
|
||||
|
||||
if (name) {
|
||||
|
||||
Reference in new issue
Block a user