return sd_varlink_replybo(
link,
SD_JSON_BUILD_PAIR_VARIANT("partitions", aj),
+ SD_JSON_BUILD_PAIR_BOOLEAN("singleFileSystem", di->single_file_system),
SD_JSON_BUILD_PAIR_STRING("imagePolicy", ps),
SD_JSON_BUILD_PAIR_UNSIGNED("imageSize", di->image_size),
SD_JSON_BUILD_PAIR_UNSIGNED("sectorSize", di->sector_size),
typedef struct MountImageReplyParameters {
sd_json_variant *partitions;
+ bool single_file_system;
char *image_policy;
uint64_t image_size;
uint32_t sector_size;
_cleanup_(mount_image_reply_parameters_done) MountImageReplyParameters p = {};
static const sd_json_dispatch_field dispatch_table[] = {
- { "partitions", SD_JSON_VARIANT_ARRAY, sd_json_dispatch_variant, offsetof(struct MountImageReplyParameters, partitions), SD_JSON_MANDATORY },
- { "imagePolicy", SD_JSON_VARIANT_STRING, sd_json_dispatch_string, offsetof(struct MountImageReplyParameters, image_policy), 0 },
- { "imageSize", _SD_JSON_VARIANT_TYPE_INVALID, sd_json_dispatch_uint64, offsetof(struct MountImageReplyParameters, image_size), SD_JSON_MANDATORY },
- { "sectorSize", _SD_JSON_VARIANT_TYPE_INVALID, sd_json_dispatch_uint32, offsetof(struct MountImageReplyParameters, sector_size), SD_JSON_MANDATORY },
- { "imageUuid", SD_JSON_VARIANT_STRING, sd_json_dispatch_id128, offsetof(struct MountImageReplyParameters, image_uuid), 0 },
+ { "partitions", SD_JSON_VARIANT_ARRAY, sd_json_dispatch_variant, offsetof(struct MountImageReplyParameters, partitions), SD_JSON_MANDATORY },
+ { "singleFileSystem", SD_JSON_VARIANT_BOOLEAN, sd_json_dispatch_stdbool, offsetof(struct MountImageReplyParameters, single_file_system), 0 },
+ { "imagePolicy", SD_JSON_VARIANT_STRING, sd_json_dispatch_string, offsetof(struct MountImageReplyParameters, image_policy), 0 },
+ { "imageSize", _SD_JSON_VARIANT_TYPE_INVALID, sd_json_dispatch_uint64, offsetof(struct MountImageReplyParameters, image_size), SD_JSON_MANDATORY },
+ { "sectorSize", _SD_JSON_VARIANT_TYPE_INVALID, sd_json_dispatch_uint32, offsetof(struct MountImageReplyParameters, sector_size), SD_JSON_MANDATORY },
+ { "imageUuid", SD_JSON_VARIANT_STRING, sd_json_dispatch_id128, offsetof(struct MountImageReplyParameters, image_uuid), 0 },
{}
};
};
}
+ di->single_file_system = p.single_file_system;
di->image_size = p.image_size;
di->sector_size = p.sector_size;
di->image_uuid = p.image_uuid;
VARLINK_DEFINE_POLKIT_INPUT,
SD_VARLINK_FIELD_COMMENT("An array with information about contained partitions that have been prepared for mounting, as well as their mount file descriptors."),
SD_VARLINK_DEFINE_OUTPUT_BY_TYPE(partitions, PartitionInfo, SD_VARLINK_ARRAY),
+ SD_VARLINK_FIELD_COMMENT("Indicates whether the image contains only a single file system, i.e. no partition table."),
+ SD_VARLINK_DEFINE_OUTPUT(singleFileSystem, SD_VARLINK_BOOL, SD_VARLINK_NULLABLE),
SD_VARLINK_FIELD_COMMENT("The used image policy."),
SD_VARLINK_DEFINE_OUTPUT(imagePolicy, SD_VARLINK_STRING, 0),
SD_VARLINK_FIELD_COMMENT("The size of the image in bytes."),