From: Zbigniew Jędrzejewski-Szmek Date: Wed, 21 Apr 2021 07:07:30 +0000 (+0200) Subject: various: print the image path when setting up of the loopback device fails X-Git-Tag: v249-rc1~342^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7b87fe4c30c3a5492ba409ebb13b1a5505c00a86;p=thirdparty%2Fsystemd.git various: print the image path when setting up of the loopback device fails --- diff --git a/src/dissect/dissect.c b/src/dissect/dissect.c index f1288b41a72..745366837f2 100644 --- a/src/dissect/dissect.c +++ b/src/dissect/dissect.c @@ -774,7 +774,7 @@ static int run(int argc, char *argv[]) { FLAGS_SET(arg_flags, DISSECT_IMAGE_NO_PARTITION_TABLE) ? 0 : LO_FLAGS_PARTSCAN, &d); if (r < 0) - return log_error_errno(r, "Failed to set up loopback device: %m"); + return log_error_errno(r, "Failed to set up loopback device for %s: %m", arg_image); r = dissect_image_and_warn( d->fd, diff --git a/src/portable/portable.c b/src/portable/portable.c index 0799bff53d1..53c4d8e25b0 100644 --- a/src/portable/portable.c +++ b/src/portable/portable.c @@ -376,7 +376,7 @@ static int portable_extract_by_path( return r; } else if (r < 0) - return log_debug_errno(r, "Failed to set up loopback device: %m"); + return log_debug_errno(r, "Failed to set up loopback device for %s: %m", path); else { _cleanup_(dissected_image_unrefp) DissectedImage *m = NULL; _cleanup_(rmdir_and_freep) char *tmpdir = NULL; diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index b4250144573..05301ef16d1 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -2741,7 +2741,7 @@ int mount_image_privately_interactively( FLAGS_SET(flags, DISSECT_IMAGE_NO_PARTITION_TABLE) ? 0 : LO_FLAGS_PARTSCAN, &d); if (r < 0) - return log_error_errno(r, "Failed to set up loopback device: %m"); + return log_error_errno(r, "Failed to set up loopback device for %s: %m", image); r = dissect_image_and_warn(d->fd, image, &verity, NULL, d->uevent_seqnum_not_before, d->timestamp_not_before, flags, &dissected_image); if (r < 0) diff --git a/src/sysext/sysext.c b/src/sysext/sysext.c index c5fdf99aa7f..76a21afea61 100644 --- a/src/sysext/sysext.c +++ b/src/sysext/sysext.c @@ -525,7 +525,7 @@ static int merge_subprocess(Hashmap *images, const char *workspace) { r = loop_device_make_by_path(img->path, O_RDONLY, 0, &d); if (r < 0) - return log_error_errno(r, "Failed to set up loopback device: %m"); + return log_error_errno(r, "Failed to set up loopback device for %s: %m", img->path); r = dissect_image_and_warn( d->fd,