liblp: MetadataBuilder::HasBlockDevice
Query whether a block device is used in the metadata. Test: pass Bug: 118506262 Change-Id: I67196b68918ac232e735b10a850299f8653e4d3f
This commit is contained in:
parent
5729cff611
commit
dca3b3bb2c
2 changed files with 8 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue