From: Lennart Poettering Date: Thu, 5 Jun 2025 11:18:45 +0000 (+0200) Subject: dissect-image: port to varlink_callbo_and_log() X-Git-Tag: v258-rc1~378^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01e82dfa960945d2705955317e11c3d517022e9b;p=thirdparty%2Fsystemd.git dissect-image: port to varlink_callbo_and_log() --- diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 34877ffa565..20afa421d15 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -67,6 +67,7 @@ #include "time-util.h" #include "udev-util.h" #include "user-util.h" +#include "varlink-util.h" #include "xattr-util.h" /* how many times to wait for the device nodes to appear */ @@ -4586,7 +4587,7 @@ int mountfsd_mount_image( } sd_json_variant *reply = NULL; - r = sd_varlink_callbo( + r = varlink_callbo_and_log( vl, "io.systemd.MountFileSystem.MountImage", &reply, @@ -4598,9 +4599,7 @@ int mountfsd_mount_image( SD_JSON_BUILD_PAIR_CONDITION(!!ps, "imagePolicy", SD_JSON_BUILD_STRING(ps)), SD_JSON_BUILD_PAIR("allowInteractiveAuthentication", SD_JSON_BUILD_BOOLEAN(FLAGS_SET(flags, DISSECT_IMAGE_ALLOW_INTERACTIVE_AUTH)))); if (r < 0) - return log_error_errno(r, "Failed to call MountImage() varlink call: %m"); - if (!isempty(error_id)) - return log_error_errno(sd_varlink_error_to_errno(error_id, reply), "Failed to call MountImage() varlink call: %s", error_id); + return r; r = sd_json_dispatch(reply, dispatch_table, SD_JSON_ALLOW_EXTENSIONS, &p); if (r < 0) @@ -4723,7 +4722,7 @@ int mountfsd_mount_directory( sd_json_variant *reply = NULL; const char *error_id = NULL; - r = sd_varlink_callbo( + r = varlink_callbo_and_log( vl, "io.systemd.MountFileSystem.MountDirectory", &reply, @@ -4735,9 +4734,7 @@ int mountfsd_mount_directory( FLAGS_SET(flags, DISSECT_IMAGE_IDENTITY_UID) ? "identity" : "auto"), SD_JSON_BUILD_PAIR_BOOLEAN("allowInteractiveAuthentication", FLAGS_SET(flags, DISSECT_IMAGE_ALLOW_INTERACTIVE_AUTH))); if (r < 0) - return log_error_errno(r, "Failed to call MountDirectory() varlink call: %m"); - if (!isempty(error_id)) - return log_error_errno(sd_varlink_error_to_errno(error_id, reply), "Failed to call MountDirectory() varlink call: %s", error_id); + return r; static const sd_json_dispatch_field dispatch_table[] = { { "mountFileDescriptor", _SD_JSON_VARIANT_TYPE_INVALID, sd_json_dispatch_uint, 0, SD_JSON_MANDATORY },