Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6af857f2 authored by Yifan Hong's avatar Yifan Hong Committed by Gerrit Code Review
Browse files

Merge "liblp: MetadataBuilder::HasBlockDevice"

parents 3a2bd498 dca3b3bb
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -713,6 +713,11 @@ bool MetadataBuilder::FindBlockDeviceByName(const std::string& partition_name,
    return false;
}

bool MetadataBuilder::HasBlockDevice(const std::string& partition_name) const {
    uint32_t index;
    return FindBlockDeviceByName(partition_name, &index);
}

bool MetadataBuilder::GetBlockDeviceInfo(const std::string& partition_name,
                                         BlockDeviceInfo* info) const {
    uint32_t index;
+3 −0
Original line number Diff line number Diff line
@@ -248,6 +248,9 @@ class MetadataBuilder {
    // false is returned.
    bool ImportPartitions(const LpMetadata& metadata, const std::set<std::string>& partition_names);

    // Return true if a block device is found, else false.
    bool HasBlockDevice(const std::string& partition_name) const;

  private:
    MetadataBuilder();
    MetadataBuilder(const MetadataBuilder&) = delete;