blob: db33d177213dc01120aed67b494ab3cf0a8a9c0a [file] [log] [blame]
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <lib/fit/result.h>
#include <optional>
#include <string>
#include "src/storage/volume_image/partition.h"
#include "src/storage/volume_image/utils/reader.h"
namespace storage::volume_image {
// Opens an existing FVM sparse image and exposes a partition that looks just as it would on the
// device i.e. if you were to serialize it to a block device, FVM would recognise it. At this time
// the reader embedded within the partition can only support sequential reads (which is all we need
// to support at this time).
fit::result<Partition, std::string> OpenSparseImage(Reader& base_reader,
std::optional<uint64_t> max_disk_size);
} // namespace storage::volume_image