Skip to content

Loopback fixes #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 21, 2025
Merged

Loopback fixes #176

merged 3 commits into from
Apr 21, 2025

Conversation

marc-hb
Copy link
Collaborator

@marc-hb marc-hb commented Apr 21, 2025

No description provided.

@marc-hb marc-hb marked this pull request as ready for review April 21, 2025 19:20
@marc-hb marc-hb requested a review from stellarhopper as a code owner April 21, 2025 19:20
@marc-hb marc-hb marked this pull request as draft April 21, 2025 21:10
@marc-hb marc-hb marked this pull request as ready for review April 21, 2025 21:28
marc-hb added 3 commits April 21, 2025 23:03
It's safe enough because we grep $_arg_rootfs

Also log the losetup -d with set -x, otherwise error messages to detach
stuff that has already been detached are too confusing.

Signed-off-by: Marc Herbert <[email protected]>
Fixes commit 60dbab3 "run_qemu.sh: de-duplicate new function
get_loopdev()" which captured the output of the entire, new
get_loopdev() function.

Among others, this sheds light on the bug fixed in the next commit (when
there is zero loopback device).

Also use fail() more, it adds a useful "FATAL: " prefix.

Eventually, fail() should probably be redirected to stderr every time?

Signed-off-by: Marc Herbert <[email protected]>
1. loopdev="$(   )" removes the trailing newline when any
2. wc -l <<<"$loopdev" re-adds a trailing new line

1+2 return the correct count EXCEPT when $loopdev is empty: 0 becomes 1!

Stop counting newlines because it's impossible to make the difference
between 0 and 1 loopback device with them. Count 'dev/loop' lines instead.

Fixes commit 47e3500 ("run_qemu: detect stale loopdev mounts")
which always did detect stale mounts but aborted without an error
message when there is no loopback mount.

Signed-off-by: Marc Herbert <[email protected]>
@marc-hb marc-hb merged commit a5317d7 into pmem:main Apr 21, 2025
2 checks passed
@marc-hb marc-hb deleted the loopback-fixes branch April 21, 2025 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants