1 #ifndef VIRTPP_IMPL_STORAGEPOOL_HPP 2 #define VIRTPP_IMPL_STORAGEPOOL_HPP 5 #include <libvirt/libvirt.h> 6 #include "../StoragePool.hpp" 7 #include "../StorageVol.hpp" 13 std::swap(underlying, oth.underlying);
18 constexpr
inline StoragePool::operator bool() const noexcept {
return underlying !=
nullptr; }
27 const auto res = virStoragePoolGetAutostart(underlying, &val);
28 return TFE{res + val};
32 const auto ret = virStoragePoolGetConnect(underlying);
39 std::optional<Info> ret;
40 return virStoragePoolGetInfo(underlying, &ret.emplace()) == 0 ? ret : std::nullopt;
43 [[nodiscard]]
inline gsl::czstring<>
StoragePool::getName() const noexcept {
return virStoragePoolGetName(underlying); }
46 std::optional<std::array<unsigned char, VIR_UUID_BUFLEN>> ret{};
47 return virStoragePoolGetUUID(underlying, ret.emplace().data()) == 0 ? ret : std::nullopt;
51 std::optional<std::array<char, VIR_UUID_STRING_BUFLEN>> ret{};
52 return virStoragePoolGetUUIDString(underlying, ret.emplace().data()) == 0 ? ret : std::nullopt;
60 return meta::light::wrap_opram_owning_set_destroyable_arr<StorageVol>(underlying, virStoragePoolListAllVolumes, 0u);
63 return meta::heavy::wrap_opram_owning_set_destroyable_arr<StorageVol>(underlying, virStoragePoolListAllVolumes, 0u);
77 return StoragePool{virStoragePoolDefineXML(conn.underlying, xml, 0)};
81 return StorageVol{virStorageVolLookupByName(underlying, name)};
auto listVolumesNames() const noexcept
Definition: StoragePool.hpp:65
bool setAutostart(bool autostart) noexcept
Definition: StoragePool.hpp:70
passive< gsl::czstring<> > getName() const noexcept
Definition: StoragePool.hpp:43
int numOfVolumes() const noexcept
Definition: StoragePool.hpp:68
static StoragePool createXML(Connection &conn, gsl::czstring<> xml, CreateFlag flags)
Definition: StoragePool.hpp:73
bool create(CreateFlag flags) noexcept
Definition: StoragePool.hpp:21
auto getInfo() const noexcept-> std::optional< Info >
Definition: StoragePool.hpp:38
static StoragePool defineXML(Connection &conn, gsl::czstring<> xml)
Definition: StoragePool.hpp:76
constexpr auto to_integral(E e) noexcept
Definition: Base.hpp:32
Definition: PoolBuildFlag.hpp:10
Connection getConnect() const noexcept
Definition: StoragePool.hpp:31
Definition: Connection.hpp:47
T passive
Definition: utility.hpp:48
Definition: PoolDeleteFlag.hpp:10
Definition: PoolCreateFlag.hpp:10
Definition: StoragePool.hpp:67
TFE getAutostart() const noexcept
Definition: StoragePool.hpp:25
bool undefine() noexcept
Definition: StoragePool.hpp:71
~StoragePool() noexcept
Definition: StoragePool.hpp:16
bool build(BuildFlag flags) noexcept
Definition: StoragePool.hpp:20
Definition: AdminConnection.hpp:11
auto listAllVolumes() const noexcept
Definition: StoragePool.hpp:59
bool refresh() noexcept
Definition: StoragePool.hpp:69
TFE isActive() const noexcept
Definition: StoragePool.hpp:57
Definition: StoragePool.hpp:11
Definition: StorageVol.hpp:10
StorageVol volLookupByName(gsl::czstring<> name) const noexcept
Definition: StoragePool.hpp:80
auto getUUID() const -> std::optional< std::array< unsigned char, VIR_UUID_BUFLEN >>
Definition: StoragePool.hpp:45
auto getUUIDString() const noexcept-> std::optional< std::array< char, VIR_UUID_STRING_BUFLEN >>
Definition: StoragePool.hpp:50
bool delete_(DeleteFlag flags) noexcept
Definition: StoragePool.hpp:22
TFE isPersistent() const noexcept
Definition: StoragePool.hpp:58
bool destroy() noexcept
Definition: StoragePool.hpp:23
constexpr StoragePool & operator=(const StoragePool &) noexcept=delete
passive< gsl::czstring<> > getXMLDesc() const noexcept
Definition: StoragePool.hpp:55
constexpr StoragePool() noexcept=default
auto extractAllVolumes() const
Definition: StoragePool.hpp:62