Skip to content

Commit 7b87fe4

Browse files
committed
various: print the image path when setting up of the loopback device fails
1 parent 409607c commit 7b87fe4

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/dissect/dissect.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ static int run(int argc, char *argv[]) {
774774
FLAGS_SET(arg_flags, DISSECT_IMAGE_NO_PARTITION_TABLE) ? 0 : LO_FLAGS_PARTSCAN,
775775
&d);
776776
if (r < 0)
777-
return log_error_errno(r, "Failed to set up loopback device: %m");
777+
return log_error_errno(r, "Failed to set up loopback device for %s: %m", arg_image);
778778

779779
r = dissect_image_and_warn(
780780
d->fd,

src/portable/portable.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ static int portable_extract_by_path(
376376
return r;
377377

378378
} else if (r < 0)
379-
return log_debug_errno(r, "Failed to set up loopback device: %m");
379+
return log_debug_errno(r, "Failed to set up loopback device for %s: %m", path);
380380
else {
381381
_cleanup_(dissected_image_unrefp) DissectedImage *m = NULL;
382382
_cleanup_(rmdir_and_freep) char *tmpdir = NULL;

src/shared/dissect-image.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2741,7 +2741,7 @@ int mount_image_privately_interactively(
27412741
FLAGS_SET(flags, DISSECT_IMAGE_NO_PARTITION_TABLE) ? 0 : LO_FLAGS_PARTSCAN,
27422742
&d);
27432743
if (r < 0)
2744-
return log_error_errno(r, "Failed to set up loopback device: %m");
2744+
return log_error_errno(r, "Failed to set up loopback device for %s: %m", image);
27452745

27462746
r = dissect_image_and_warn(d->fd, image, &verity, NULL, d->uevent_seqnum_not_before, d->timestamp_not_before, flags, &dissected_image);
27472747
if (r < 0)

src/sysext/sysext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ static int merge_subprocess(Hashmap *images, const char *workspace) {
525525

526526
r = loop_device_make_by_path(img->path, O_RDONLY, 0, &d);
527527
if (r < 0)
528-
return log_error_errno(r, "Failed to set up loopback device: %m");
528+
return log_error_errno(r, "Failed to set up loopback device for %s: %m", img->path);
529529

530530
r = dissect_image_and_warn(
531531
d->fd,

0 commit comments

Comments
 (0)