libstorage-ng
Toggle main menu visibility
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
30
namespace
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
72
BlkDevice
*
get_blk_device
();
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
97
LvmVg
*
get_lvm_vg
();
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
virtual
std::unique_ptr<Device> clone_v2()
const override
;
113
114
LvmPv(Impl* impl);
115
ST_NO_SWIG LvmPv(std::unique_ptr<Device::Impl>&& impl);
116
117
};
118
119
125
bool
is_lvm_pv
(
const
Device
* device);
126
133
LvmPv
*
to_lvm_pv
(
Device
* device);
134
138
const
LvmPv
*
to_lvm_pv
(
const
Device
* device);
139
140
}
141
142
#endif
storage::BlkDevice
An abstract Block Device.
Definition
BlkDevice.h:50
storage::Device
An abstract base class for storage devices.
Definition
Device.h:82
storage::Devicegraph
The main container of the libstorage-ng.
Definition
Devicegraph.h:170
storage::LvmPv
Definition
LvmPv.h:37
storage::LvmPv::has_lvm_vg
bool has_lvm_vg() const
Check whether the physical volume is part of a volume group.
storage::LvmPv::get_lvm_vg
const LvmVg * get_lvm_vg() const
Return the volume group the physical volume is used in.
storage::LvmPv::get_all
static std::vector< LvmPv * > get_all(Devicegraph *devicegraph)
Get all LvmPvs.
storage::LvmPv::get_lvm_vg
LvmVg * get_lvm_vg()
Return the volume group the physical volume is used in.
storage::LvmPv::get_blk_device
const BlkDevice * get_blk_device() const
Return the block device this physical volume is using.
storage::LvmPv::has_blk_device
bool has_blk_device() const
Check whether the physical volume has a block device.
storage::LvmPv::get_usable_size
unsigned long long get_usable_size() const
Get the size of the PV usable for extents in bytes.
storage::LvmPv::get_blk_device
BlkDevice * get_blk_device()
Return the block device this physical volume is using.
storage::LvmPv::get_all
static std::vector< const LvmPv * > get_all(const Devicegraph *devicegraph)
Get all LvmPvs.
storage::LvmPv::create
static LvmPv * create(Devicegraph *devicegraph)
Create a device of type LvmPv.
storage::LvmVg
A Volume Group of the Logical Volume Manager (LVM).
Definition
LvmVg.h:61
storage
The storage namespace.
Definition
Actiongraph.h:40
storage::is_lvm_pv
bool is_lvm_pv(const Device *device)
Checks whether device points to a LvmPv.
storage::to_lvm_pv
LvmPv * to_lvm_pv(Device *device)
Converts pointer to Device to pointer to LvmPv.
storage
Devices
LvmPv.h
Generated by
1.17.0