libstorage-ng
 
Loading...
Searching...
No Matches
LvmPv.h
1/*
2 * Copyright (c) [2016-2019] SUSE LLC
3 *
4 * All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of version 2 of the GNU General Public License as published
8 * by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, contact Novell, Inc.
17 *
18 * To contact Novell about this file by physical or electronic mail, you may
19 * find current contact information at www.novell.com.
20 */
21
22
23#ifndef STORAGE_LVM_PV_H
24#define STORAGE_LVM_PV_H
25
26
27#include "storage/Devices/Device.h"
28
29
30namespace storage
31{
32 class BlkDevice;
33 class LvmVg;
34
35
36 class LvmPv : public Device
37 {
38 public:
39
46 static LvmPv* create(Devicegraph* devicegraph);
47
48 static LvmPv* load(Devicegraph* devicegraph, const xmlNode* node);
49
53 static std::vector<LvmPv*> get_all(Devicegraph* devicegraph);
54
58 static std::vector<const LvmPv*> get_all(const Devicegraph* devicegraph);
59
65 bool has_blk_device() const;
66
73
77 const BlkDevice* get_blk_device() const;
78
85 unsigned long long get_usable_size() const;
86
90 bool has_lvm_vg() const;
91
98
102 const LvmVg* get_lvm_vg() const;
103
104 public:
105
106 class Impl;
107
108 Impl& get_impl();
109 const Impl& get_impl() const;
110
111 virtual LvmPv* clone() const override;
112
113 LvmPv(Impl* impl);
114
115 };
116
117
123 bool is_lvm_pv(const Device* device);
124
132
136 const LvmPv* to_lvm_pv(const Device* device);
137
138}
139
140#endif
An abstract Block Device.
Definition BlkDevice.h:49
An abstract base class for storage devices.
Definition Device.h:82
The main container of the libstorage-ng.
Definition Devicegraph.h:170
Definition LvmPv.h:37
bool has_lvm_vg() const
Check whether the physical volume is part of a volume group.
const LvmVg * get_lvm_vg() const
Return the volume group the physical volume is used in.
static std::vector< LvmPv * > get_all(Devicegraph *devicegraph)
Get all LvmPvs.
LvmVg * get_lvm_vg()
Return the volume group the physical volume is used in.
const BlkDevice * get_blk_device() const
Return the block device this physical volume is using.
bool has_blk_device() const
Check whether the physical volume has a block device.
unsigned long long get_usable_size() const
Get the size of the PV usable for extents in bytes.
BlkDevice * get_blk_device()
Return the block device this physical volume is using.
static std::vector< const LvmPv * > get_all(const Devicegraph *devicegraph)
Get all LvmPvs.
static LvmPv * create(Devicegraph *devicegraph)
Create a device of type LvmPv.
A Volume Group of the Logical Volume Manager (LVM).
Definition LvmVg.h:61
The storage namespace.
Definition Actiongraph.h:40
bool is_lvm_pv(const Device *device)
Checks whether device points to a LvmPv.
LvmPv * to_lvm_pv(Device *device)
Converts pointer to Device to pointer to LvmPv.