8 #include <libvirt/libvirt.h> 9 #include "../Connection.hpp" 10 #include "../CpuMap.hpp" 12 #include "../Stream.hpp" 13 #include "../TypesParam.hpp" 16 constexpr
inline Domain::Domain(virDomainPtr ptr) noexcept : underlying(ptr) {}
17 constexpr
inline Domain::Domain(
Domain&& dom) noexcept : underlying(dom.underlying) { dom.underlying =
nullptr; }
21 underlying = d.underlying;
22 d.underlying =
nullptr;
28 virDomainFree(underlying);
31 constexpr
inline Domain::operator bool() const noexcept {
return underlying !=
nullptr; }
41 return virDomainAddIOThread(underlying, iothread_id,
to_integral(flags)) == 0;
44 inline bool Domain::attachDevice(gsl::czstring<> xml) noexcept {
return virDomainAttachDevice(underlying, xml) == 0; }
47 return virDomainAttachDeviceFlags(underlying, xml,
to_integral(flags)) == 0;
50 inline bool Domain::blockCommit(gsl::czstring<> disk, gsl::czstring<> base, gsl::czstring<> top,
unsigned long bandwidth,
52 return virDomainBlockCommit(underlying, disk, base, top, bandwidth,
to_integral(flags)) >= 0;
56 return virDomainBlockCopy(underlying, disk, destxml, params.underlying, params.size,
to_integral(flags)) >= 0;
60 return virDomainBlockJobAbort(underlying, disk,
to_integral(flags)) >= 0;
64 return virDomainBlockJobSetSpeed(underlying, disk, bandwidth,
to_integral(flags)) >= 0;
67 inline bool Domain::blockPeek(gsl::czstring<> disk,
unsigned long long offset, gsl::span<std::byte> buffer)
const noexcept {
68 return virDomainBlockPeek(underlying, disk, offset, buffer.size(), buffer.data(), 0) >= 0;
72 return virDomainBlockPull(underlying, disk, bandwidth,
to_integral(flags)) >= 0;
76 return virDomainBlockRebase(underlying, disk, base, bandwidth,
to_integral(flags)) >= 0;
80 return virDomainBlockResize(underlying, disk, size,
to_integral(flags)) >= 0;
85 underlying, [=](virDomainPtr) {
return size; },
86 [=](virDomainPtr u, virDomainBlockStatsPtr ptr,
size_t n) {
return virDomainBlockStats(u, disk, ptr, n); });
91 underlying, [=](virDomainPtr u, virTypedParameterPtr ptr,
int* n) {
return virDomainBlockStatsFlags(u, disk, ptr, n,
to_integral(flags)); });
94 inline bool Domain::create() noexcept {
return virDomainCreate(underlying) == 0; }
99 return virDomainCoreDump(underlying, to.c_str(),
to_integral(flags)) == 0;
107 return virDomainDelIOThread(underlying, iothread_id,
to_integral(flags)) == 0;
114 inline bool Domain::detachDevice(gsl::czstring<> xml) noexcept {
return virDomainDetachDevice(underlying, xml) == 0; }
117 return virDomainDetachDeviceFlags(underlying, xml,
to_integral(flags)) == 0;
121 return virDomainDetachDeviceAlias(underlying, alias,
to_integral(flags)) == 0;
125 return virDomainFSFreeze(underlying, mountpoints.data(), mountpoints.size(), 0);
129 return virDomainFSThaw(underlying, mountpoints.data(), mountpoints.size(), 0);
132 inline bool Domain::fsTrim(gsl::czstring<> mountpoint,
unsigned long long minimum) noexcept {
133 return virDomainFSTrim(underlying, mountpoint, minimum, 0) == 0;
138 virDomainGetAutostart(underlying, &val);
146 [[nodiscard]]
inline auto Domain::getBlockInfo(gsl::czstring<> disk)
const noexcept -> std::optional<virDomainBlockInfo> {
147 std::optional<virDomainBlockInfo> ret;
148 auto& info = ret.emplace();
149 return virDomainGetBlockInfo(underlying, disk, &info, 0) >= 0 ? ret : std::nullopt;
154 underlying, [=](
auto* u,
auto ptr,
auto* n,
auto f) {
return virDomainGetBlockIoTune(u, disk, ptr, n, f); },
to_integral(flags));
158 std::optional<virDomainBlockJobInfo> ret;
159 auto& info = ret.emplace();
160 return virDomainGetBlockJobInfo(underlying, disk, &info,
to_integral(flags)) >= 0 ? ret : std::nullopt;
164 const auto res = virDomainGetConnect(underlying);
171 virDomainControlInfo info;
172 return virDomainGetControlInfo(underlying, &info, 0) == 0 ? std::optional{info} : std::nullopt;
178 return (res = virDomainGetCPUStats(u, tpu, *size, -1, 1, 0)), (static_cast<bool>(tpu) ? res : (*size = res));
184 return (res = virDomainGetCPUStats(u, tpu, *size, start_cpu, ncpus, 0)), (static_cast<bool>(tpu) ? res : (*size = res));
189 return meta::light::wrap_oparm_owning_fill_autodestroyable_arr<DiskError>(
190 underlying, +[](decltype(underlying) u) {
return virDomainGetDiskErrors(u,
nullptr, 0, 0); },
191 +[](decltype(underlying) u, virDomainDiskErrorPtr ptr,
int n) {
return virDomainGetDiskErrors(u, ptr, n, 0); });
195 return meta::heavy::wrap_oparm_owning_fill_autodestroyable_arr<DiskError>(
196 underlying, +[](decltype(underlying) u) {
return virDomainGetDiskErrors(u,
nullptr, 0, 0); },
197 +[](decltype(underlying) u, virDomainDiskErrorPtr ptr,
int n) {
return virDomainGetDiskErrors(u, ptr, n, 0); });
207 return meta::light::wrap_opram_owning_set_destroyable_arr<virDomainFSInfo, UniqueSpan, virDomainFSInfoFree>(underlying, virDomainGetFSInfo, 0u);
211 return meta::heavy::wrap_opram_owning_set_destroyable_arr<FSInfo>(underlying, virDomainGetFSInfo, 0u);
217 underlying, [&](
auto* u,
auto ptr,
auto* n,
auto f) {
return virDomainGetJobStats(u, &jt, ptr, n, f); },
to_integral(flags));
224 [](
auto& u,
auto ls,
auto pcnt,
auto... args) {
return virDomainGetGuestVcpus(u, ls, reinterpret_cast<unsigned*>(pcnt), args...); }, 0);
232 return meta::light::wrap_opram_owning_set_destroyable_arr<light::IOThreadInfo>(underlying, virDomainGetIOThreadInfo,
237 return meta::heavy::wrap_opram_owning_set_destroyable_arr<heavy::IOThreadInfo>(underlying, virDomainGetIOThreadInfo,
243 virDomainGetInfo(underlying, &info);
249 underlying, [=](
auto u,
auto&&... args) {
return virDomainGetInterfaceParameters(u, device, args...); },
to_integral(flags));
253 std::optional<JobInfo> ret{JobInfo{}};
254 return virDomainGetJobInfo(underlying, &*ret) == 0 ? ret : std::nullopt;
261 [[nodiscard]]
inline int Domain::getMaxVcpus() const noexcept {
return virDomainGetMaxVcpus(underlying); }
274 return std::string{
static_cast<const char*
>(
getMetadata(type, ns, flags))};
277 [[nodiscard]]
inline gsl::czstring<>
Domain::getName() const noexcept {
return virDomainGetName(underlying); }
283 [[nodiscard]]
inline unsigned Domain::getID() const noexcept {
return virDomainGetID(underlying); }
286 return virDomainGetVcpusFlags(underlying,
to_integral(flags));
290 std::pair<UniqueZstring, int> ret{};
291 ret.first = UniqueZstring{virDomainGetSchedulerType(underlying, &ret.second)};
296 auto ret = std::make_unique<virSecurityLabel>();
297 return virDomainGetSecurityLabel(underlying, ret.get()) == 0 ? std::move(ret) : std::unique_ptr<virSecurityLabel>{
nullptr};
301 return meta::light::wrap_opram_owning_set_destroyable_arr<virSecurityLabel>(underlying, virDomainGetSecurityLabelList);
311 const auto res = virDomainGetState(underlying, &state, &reason, 0);
315 case VIR_DOMAIN_NOSTATE:
317 case VIR_DOMAIN_RUNNING:
319 case VIR_DOMAIN_BLOCKED:
321 case VIR_DOMAIN_PAUSED:
323 case VIR_DOMAIN_SHUTDOWN:
325 case VIR_DOMAIN_SHUTOFF:
327 case VIR_DOMAIN_CRASHED:
329 case VIR_DOMAIN_PMSUSPENDED:
340 std::optional<TimeRet> ret{};
341 auto& time = ret.emplace();
342 return virDomainGetTime(underlying, &time.seconds, &time.nanosec, 0) == 0 ? ret : std::nullopt;
346 using RetType = std::array<unsigned char, VIR_UUID_BUFLEN>;
348 const auto res = virDomainGetUUID(underlying, ret.data());
350 throw std::runtime_error{
"virDomainGetUUID"};
355 std::array<char, VIR_UUID_STRING_BUFLEN> ret{};
356 return virDomainGetUUIDString(underlying, ret.data()) == 0 ? std::optional(ret) : std::nullopt;
361 ret.resize(VIR_UUID_STRING_BUFLEN);
362 virDomainGetUUIDString(underlying, ret.data());
363 ret.resize(std::strlen(ret.data()));
369 return std::unique_ptr<char[], void (*)(char*)>{virDomainGetOSType(underlying), freeany<char[]>};
372 [[nodiscard]]
inline unsigned long Domain::getMaxMemory() const noexcept {
return virDomainGetMaxMemory(underlying); }
380 if (!sche_type.first)
381 return std::optional<TypedParams>{std::nullopt};
384 [n = sche_type.second](
auto*, std::nullptr_t,
int* c) {
388 virDomainGetSchedulerParameters);
393 if (!sche_type.first)
394 return std::optional<TypedParams>{std::nullopt};
397 [n = sche_type.second](
auto*, std::nullptr_t,
int* c,
auto) {
401 virDomainGetSchedulerParametersFlags,
to_integral(flags));
406 underlying, [&](decltype(underlying) u) ->
int {
return getInfo().nrVirtCpu; },
407 [=](decltype(underlying) u,
unsigned char* ptr,
int n) {
return virDomainGetVcpuPinInfo(u, n, ptr, VIR_CPU_MAPLEN(n),
to_integral(flags)); });
412 std::vector<virVcpuInfo> infos{};
413 std::vector<unsigned char> cpumaps{};
416 std::optional<Ret> ret{Ret{}};
418 const auto nvcpu =
getInfo().nrVirtCpu;
419 st.cpumap_size = VIR_CPU_MAPLEN(nvcpu);
420 st.infos.resize(nvcpu);
421 st.cpumaps.resize(st.cpumap_size * nvcpu);
422 const auto res = virDomainGetVcpus(underlying, st.infos.data(), nvcpu, st.cpumaps.data(), VIR_CPU_MAPLEN(nvcpu));
423 return res >= 0 ? ret : std::nullopt;
432 [[nodiscard]]
inline bool Domain::injectNMI() noexcept {
return virDomainInjectNMI(underlying, 0) == 0; }
435 return meta::light::wrap_opram_owning_set_destroyable_arr<InterfaceView, UniqueSpan>(underlying, virDomainInterfaceAddresses,
to_integral(source),
440 return meta::heavy::wrap_opram_owning_set_destroyable_arr<Interface>(underlying, virDomainInterfaceAddresses,
to_integral(source), 0u);
443 [[nodiscard]]
inline auto Domain::interfaceStats(gsl::czstring<> device)
const noexcept -> std::optional<virDomainInterfaceStatsStruct> {
444 std::optional<virDomainInterfaceStatsStruct> ret{virDomainInterfaceStatsStruct{}};
446 return virDomainInterfaceStats(underlying, device, &s,
sizeof(std::remove_reference_t<decltype(s)>)) ? ret : std::nullopt;
454 return virDomainPMSuspendForDuration(underlying, target, duration, 0) == 0;
462 return virDomainManagedSaveDefineXML(underlying, dxml,
to_integral(flags)) == 0;
476 return virDomainMemoryPeek(underlying, start, buffer.size(), buffer.data(),
to_integral(flags)) == 0;
481 underlying, [=](decltype(underlying)) {
return nr_stats; }, virDomainMemoryStats, 0u);
485 unsigned long bandwidth) noexcept {
486 return Domain{virDomainMigrate(underlying, dconn.underlying,
to_integral(flags), dname, uri, bandwidth)};
490 gsl::czstring<> uri,
unsigned long bandwidth) noexcept {
491 return Domain{virDomainMigrate2(underlying, dconn.underlying, dxml,
to_integral(flags), dname, uri, bandwidth)};
495 return Domain{virDomainMigrate3(underlying, dconn.underlying, params.underlying, params.size,
to_integral(flags))};
499 return virDomainMigrateToURI(underlying, duri,
to_integral(flags), dname, bandwidth) >= 0;
503 gsl::czstring<> dname,
unsigned long bandwidth) noexcept {
504 return virDomainMigrateToURI2(underlying, dconnuri, miguri, dxml,
to_integral(flags), dname, bandwidth) >= 0;
508 return virDomainMigrateToURI3(underlying, dconnuri, params.underlying, params.size,
to_integral(flags)) >= 0;
512 unsigned long long v;
513 return virDomainMigrateGetCompressionCache(underlying, &v, 0) == 0 ? std::optional{v} : std::nullopt;
517 unsigned long long v;
518 return virDomainMigrateGetMaxDowntime(underlying, &v, 0) == 0 ? std::optional{v} : std::nullopt;
523 return virDomainMigrateGetMaxSpeed(underlying, &v,
to_integral(flags)) == 0 ? std::optional{v} : std::nullopt;
527 return virDomainMigrateSetCompressionCache(underlying, cacheSize, 0) == 0;
531 return virDomainMigrateSetMaxDowntime(underlying, downtime, 0) == 0;
535 return virDomainMigrateSetMaxSpeed(underlying, bandwidth,
to_integral(flags)) == 0;
541 return virDomainOpenChannel(underlying, name, st.underlying,
to_integral(flags)) >= 0;
545 return virDomainOpenConsole(underlying, dev_name, st.underlying,
to_integral(flags)) >= 0;
549 return virDomainOpenGraphics(underlying, idx, fd,
to_integral(flags)) >= 0;
553 return virDomainOpenGraphicsFD(underlying, idx,
to_integral(flags));
557 return virDomainPinEmulator(underlying, cpumap.underlying, cpumap.maplen,
to_integral(flags)) >= 0;
561 return virDomainPinIOThread(underlying, iothread_id, cpumap.underlying, cpumap.maplen,
to_integral(flags)) >= 0;
565 return virDomainPinVcpu(underlying, vcpu, cpumap.underlying, cpumap.maplen) >= 0;
569 return virDomainPinVcpuFlags(underlying, vcpu, cpumap.underlying, cpumap.maplen,
to_integral(flags)) >= 0;
573 return virDomainSendKey(underlying,
to_integral(codeset), holdtime, const_cast<unsigned int*>(keycodes.data()), keycodes.size(), 0) >= 0;
577 return virDomainSendProcessSignal(underlying, pid_value,
to_integral(signum), 0) >= 0;
582 inline bool Domain::setMemory(
unsigned long mem) {
return virDomainSetMemory(underlying, mem) == 0; }
585 return virDomainSetMemoryStatsPeriod(underlying, period,
to_integral(flags)) >= 0;
588 [[nodiscard]]
inline bool Domain::isActive() const noexcept {
return virDomainIsActive(underlying) != 0; }
593 inline bool Domain::rename(gsl::czstring<> name) {
return virDomainRename(underlying, name, 0) == 0; }
597 inline bool Domain::resume() noexcept {
return virDomainResume(underlying) == 0; }
599 inline bool Domain::save(gsl::czstring<> to) noexcept {
return virDomainSave(underlying, to) == 0; }
602 return virDomainSaveFlags(underlying, to, dxml,
to_integral(flags)) == 0;
606 return UniqueZstring{virDomainScreenshot(underlying, stream.underlying, screen, 0)};
612 return virDomainSetBlkioParameters(underlying, params.underlying, params.size,
to_integral(flags)) >= 0;
616 return virDomainSetBlockIoTune(underlying, disk, params.underlying, params.size,
to_integral(flags)) >= 0;
620 return virDomainSetBlockThreshold(underlying, dev, threshold, 0) >= 0;
623 inline bool Domain::setGuestVcpus(gsl::czstring<> cpumap,
bool state) noexcept {
return virDomainSetGuestVcpus(underlying, cpumap, state, 0) >= 0; }
626 return virDomainSetIOThreadParams(underlying, iothread_id, params.underlying, params.size,
to_integral(flags)) >= 0;
630 return virDomainSetInterfaceParameters(underlying, device, params.underlying, params.size,
to_integral(flags)) >= 0;
638 return virDomainSetMemoryFlags(underlying, memory,
to_integral(flags)) >= 0;
642 return virDomainSetMemoryParameters(underlying, params.underlying, params.size,
to_integral(flags)) >= 0;
646 return virDomainSetNumaParameters(underlying, params.underlying, params.size,
to_integral(flags)) >= 0;
650 return virDomainSetPerfEvents(underlying, params.underlying, params.size,
to_integral(flags)) >= 0;
654 return virDomainSetSchedulerParameters(underlying, params.underlying, params.size) >= 0;
658 return virDomainSetSchedulerParametersFlags(underlying, params.underlying, params.size,
to_integral(flags)) >= 0;
667 return virDomainSetTime(underlying, seconds, nseconds,
to_integral(flags));
671 return virDomainSetUserPassword(underlying, user, password,
to_integral(flags));
675 return virDomainSetVcpu(underlying, vcpumap, state,
to_integral(flags)) >= 0;
678 inline bool Domain::setVcpus(
unsigned int nvcpus) noexcept {
return virDomainSetVcpus(underlying, nvcpus) == 0; }
681 return virDomainSetVcpusFlags(underlying, nvcpus,
to_integral(flags)) == 0;
695 return virDomainUpdateDeviceFlags(underlying, xml,
to_integral(flags)) >= 0;
698 inline Domain::StatsRecord::StatsRecord(
const virDomainStatsRecord& from) noexcept : dom(from.dom) {
699 params.reserve(static_cast<std::size_t>(from.nparams));
700 std::transform(from.params, from.params + from.nparams, std::back_inserter(params),
701 [](
const virTypedParameter&
tp) { return TypedParameter{tp}; });
Format
Definition: Decls.hpp:32
bool destroy() noexcept
Definition: Domain.hpp:110
auto extractSecurityLabelList() const -> std::vector< virSecurityLabel >
Definition: Domain.hpp:304
auto migrateGetMaxDowntime() const noexcept-> std::optional< unsigned long long >
Definition: Domain.hpp:516
auto getBlockIoTune(gsl::czstring<> disk, enums::domain::MITPFlags flags) const noexcept
Definition: Domain.hpp:152
~Domain() noexcept
Definition: Domain.hpp:26
bool reboot()
Definition: Domain.hpp:591
Definition: BlockJobInfoFlag.hpp:7
Definition: TypesParam.hpp:29
std::string managedSaveExtractXMLDesc(enums::domain::SaveImageXMLFlag flag) const noexcept
Definition: Domain.hpp:469
Definition: Stream.hpp:10
int fsThaw(gsl::span< gsl::czstring<>> mountpoints) noexcept
Definition: Domain.hpp:128
bool setLifecycleAction(enums::domain::Lifecycle type, enums::domain::LifecycleAction action, enums::domain::ModificationImpactFlag flags) noexcept
Definition: Domain.hpp:632
#define UNREACHABLE
Definition: utility.hpp:19
auto extractUUIDString() const -> std::string
Definition: Domain.hpp:359
auto getUUIDString() const noexcept-> std::optional< std::array< char, VIR_UUID_STRING_BUFLEN >>
Definition: Domain.hpp:354
bool setBlkioParameters(TypedParams params, enums::domain::ModificationImpactFlag flags) noexcept
Definition: Domain.hpp:611
bool isActive() const noexcept
Definition: Domain.hpp:588
auto getTotalCPUStats() const noexcept
Definition: Domain.hpp:175
int fsFreeze(gsl::span< gsl::czstring<>> mountpoints) noexcept
Definition: Domain.hpp:124
VCpuFlag
Definition: Decls.hpp:208
UniqueZstring getXMLDesc(enums::domain::XMLFlags flag) const noexcept
Definition: Domain.hpp:426
Definition: GFlags.hpp:10
Definition: GetJobStatsFlag.hpp:7
bool detachDeviceAlias(gsl::czstring<> alias, enums::domain::DeviceModifyFlag flag) noexcept
Definition: Domain.hpp:120
Definition: UndefineFlag.hpp:7
UniqueZstring getMetadata(enums::domain::MetadataType type, gsl::czstring<> ns, enums::domain::ModificationImpactFlag flags) const noexcept
Definition: Domain.hpp:267
TypePair< T, U > tp
Definition: utils.hpp:19
UniqueZstring managedSaveGetXMLDesc(enums::domain::SaveImageXMLFlag flag) const noexcept
Definition: Domain.hpp:465
auto blockStats(gsl::czstring<> disk, size_t size) const noexcept
Definition: Domain.hpp:83
constexpr auto to_integral(E e) noexcept
Definition: Base.hpp:32
int getMaxVcpus() const noexcept
Definition: Domain.hpp:261
bool setAutoStart(bool)
Definition: Domain.hpp:609
auto getBlkioParameters(enums::domain::MITPFlags flags) const noexcept
Definition: Domain.hpp:142
bool save(gsl::czstring<> to) noexcept
Definition: Domain.hpp:599
static auto wrap_oparm_set_tp(U *underlying, Fcn fcn, Args...args) -> std::optional< virt::TypedParams >
Definition: TypesParam.hpp:127
bool managedSaveRemove() noexcept
Definition: Domain.hpp:473
bool detachDevice(gsl::czstring<> xml) noexcept
Definition: Domain.hpp:114
Definition: Domain.hpp:554
bool pinVcpu(unsigned int vcpu, CpuMap cpumap) noexcept
Definition: Domain.hpp:564
bool blockCopy(gsl::czstring<> disk, gsl::czstring<> destxml, const TypedParams ¶ms, enums::domain::BlockCopyFlag flags) noexcept
Definition: Domain.hpp:55
Domain migrate(Connection dconn, enums::domain::MigrateFlag flags, gsl::czstring<> dname, gsl::czstring<> uri, unsigned long bandwidth) noexcept
Definition: Domain.hpp:484
std::vector< FSInfo > extractFSInfo() const
Definition: Domain.hpp:210
Definition: BlockPullFlag.hpp:7
std::string extractMetadata(enums::domain::MetadataType type, gsl::czstring<> ns, enums::domain::ModificationImpactFlag flags) const
Definition: Domain.hpp:272
bool delIOThread(unsigned int iothread_id, enums::domain::ModificationImpactFlag flags) noexcept
Definition: Domain.hpp:106
auto getNumaParameters(enums::domain::MITPFlags flags) const noexcept
Definition: Domain.hpp:279
bool openChannel(gsl::czstring<> name, Stream &st, enums::domain::ChannelFlag flags) noexcept
Definition: Domain.hpp:540
bool migrateToURI(gsl::czstring<> duri, enums::domain::MigrateFlag flags, gsl::czstring<> dname, unsigned long bandwidth) noexcept
Definition: Domain.hpp:498
SetTimeFlag
Definition: Decls.hpp:202
auto getDiskErrors() const noexcept
Definition: Domain.hpp:188
bool abortJob() noexcept
Definition: Domain.hpp:38
std::optional< TypedParams > getGuestVcpus() const noexcept
Definition: Domain.hpp:221
bool setMemoryFlags(unsigned long memory, enums::domain::MemoryModFlag flags) noexcept
Definition: Domain.hpp:637
bool reset()
Definition: Domain.hpp:595
bool setMemoryStatsPeriod(int period, enums::domain::MemoryModFlag flags) noexcept
Definition: Domain.hpp:584
bool shutdown() noexcept
Definition: Domain.hpp:684
auto getMemoryParameters(enums::domain::MITPFlags flags) const noexcept
Definition: Domain.hpp:263
bool getAutostart() const noexcept
Definition: Domain.hpp:136
Definition: Connection.hpp:47
Crashed
Definition: Decls.hpp:116
bool addIOThread(unsigned int iothread_id, enums::domain::ModificationImpactFlag flags) noexcept
Definition: Domain.hpp:40
auto getBlockJobInfo(gsl::czstring<> disk, enums::domain::BlockJobInfoFlag flags) const noexcept
Definition: Domain.hpp:157
bool blockResize(gsl::czstring<> disk, unsigned long long size, enums::domain::BlockResizeFlag flags) noexcept
Definition: Domain.hpp:79
bool setSchedulerParameters(TypedParams params) noexcept
Definition: Domain.hpp:653
static auto wrap_oparm_fill_tp(U *underlying, CountFcn count_fcn, DataFcn data_fcn, Args...args) -> std::optional< virt::TypedParams >
Definition: TypesParam.hpp:136
Definition: ConsoleFlag.hpp:7
Blocked
Definition: Decls.hpp:78
bool rename(gsl::czstring<>)
Definition: Domain.hpp:593
auto migrateGetCompressionCache() const noexcept-> std::optional< unsigned long long >
Definition: Domain.hpp:511
TFE isUpdated() const noexcept
Definition: Domain.hpp:451
gsl::czstring getName() const noexcept
Definition: Domain.hpp:277
Definition: Lifecycle.hpp:7
bool setMaxMemory(unsigned long)
Definition: Domain.hpp:580
bool blockPull(gsl::czstring<> disk, unsigned long bandwidth, enums::domain::BlockPullFlag flags) noexcept
Definition: Domain.hpp:71
bool setBlockIoTune(gsl::czstring<> disk, TypedParams params, enums::domain::ModificationImpactFlag flags) noexcept
Definition: Domain.hpp:615
Definition: ProcessSignal.hpp:7
bool memoryPeek(unsigned long long start, gsl::span< unsigned char > buffer, enums::domain::MemoryFlag flag) const noexcept
Definition: Domain.hpp:475
auto getOSType() const
Definition: Domain.hpp:368
Definition: BlockCopyFlag.hpp:7
bool attachDevice(gsl::czstring<> xml) noexcept
Definition: Domain.hpp:44
auto getJobStats(enums::domain::GetJobStatsFlag flags) const noexcept
Definition: Domain.hpp:214
bool create() noexcept
Definition: Domain.hpp:94
bool PMSuspendForDuration(unsigned target, unsigned long long duration) noexcept
Definition: Domain.hpp:453
bool fsTrim(gsl::czstring<> mountpoint, unsigned long long minimum) noexcept
Definition: Domain.hpp:132
PMSuspended
Definition: Decls.hpp:121
Definition: CreateFlag.hpp:7
bool sendKey(enums::domain::KeycodeSet codeset, unsigned int holdtime, gsl::span< const unsigned int > keycodes) noexcept
Definition: Domain.hpp:572
UniqueZstring screenshot(Stream &stream, unsigned int screen) const noexcept
Definition: Domain.hpp:605
Definition: BlockRebaseFlag.hpp:7
auto getCPUStats(unsigned start_cpu, unsigned ncpus) const noexcept
Definition: Domain.hpp:181
std::string extractHostname() const noexcept
Definition: Domain.hpp:229
static Domain createXML(Connection &, gsl::czstring<> xml, enums::domain::CreateFlag flags)
Definition: Domain.hpp:33
auto memoryStats(unsigned int nr_stats) const noexcept
Definition: Domain.hpp:479
Definition: MetadataType.hpp:7
bool blockCommit(gsl::czstring<> disk, gsl::czstring<> base, gsl::czstring<> top, unsigned long bandwidth, enums::domain::BlockCommitFlag flags) noexcept
Definition: Domain.hpp:50
Definition: BlockCommitFlag.hpp:7
virDomainInfo Info
Definition: Domain.hpp:102
bool setMemory(unsigned long)
Definition: Domain.hpp:582
std::vector< DiskError > extractDiskErrors() const
Definition: Domain.hpp:194
Definition: BlockJobAbortFlag.hpp:7
bool openGraphics(unsigned int idx, int fd, enums::domain::OpenGraphicsFlag flags) const noexcept
Definition: Domain.hpp:548
TFE isPersistent() const noexcept
Definition: Domain.hpp:449
bool PMWakeup() noexcept
Definition: Domain.hpp:457
Definition: utility.hpp:122
int getNumVcpus(enums::domain::VCpuFlag flags) const noexcept
Definition: Domain.hpp:285
Definition: KeycodeSet.hpp:7
SetUserPasswordFlag
Definition: Decls.hpp:205
UniqueZstring getHostname() const noexcept
Definition: Domain.hpp:227
Domain & operator=(const Domain &)=delete
Definition: AdminConnection.hpp:11
Definition: MigrateFlag.hpp:7
auto interfaceStats(gsl::czstring<> device) const noexcept-> std::optional< virDomainInterfaceStatsStruct >
Definition: Domain.hpp:443
Definition: MemoryModFlag.hpp:7
bool setPerfEvents(TypedParams params, enums::domain::ModificationImpactFlag flags) noexcept
Definition: Domain.hpp:649
bool sendProcessSignal(long long pid_value, enums::domain::ProcessSignal signum) noexcept
Definition: Domain.hpp:576
NoState
Definition: Decls.hpp:60
auto migrateGetMaxSpeed(unsigned int flag) const noexcept-> std::optional< unsigned long >
Definition: Domain.hpp:521
bool setGuestVcpus(gsl::czstring<> cpumap, bool state) noexcept
Definition: Domain.hpp:623
bool setBlockThreshold(gsl::czstring<> dev, unsigned long long threshold) noexcept
Definition: Domain.hpp:619
bool suspend() noexcept
Definition: Domain.hpp:688
Definition: LifecycleAction.hpp:7
bool coreDump(std::filesystem::path to, enums::domain::core_dump::Flag flags) const noexcept
Definition: Domain.hpp:98
InterfaceAddressesSource
Definition: Decls.hpp:40
bool migrateSetCompressionCache(unsigned long long cacheSize) noexcept
Definition: Domain.hpp:526
Definition: Domain.hpp:492
auto getInterfaceParameters(gsl::czstring<> device, enums::domain::MITPFlags flags) const noexcept
Definition: Domain.hpp:247
Definition: SaveRestoreFlag.hpp:9
auto blockStatsFlags(gsl::czstring<> disk, enums::TypedParameterFlag flags) const noexcept
Definition: Domain.hpp:89
Definition: Domain.hpp:474
auto getVcpus() const noexcept
Definition: Domain.hpp:410
Definition: BlockJobSetSpeedFlag.hpp:7
bool migrateStartPostCopy(unsigned int flag) noexcept
Definition: Domain.hpp:538
Shutoff
Definition: Decls.hpp:104
auto interfaceAddresses(enums::domain::InterfaceAddressesSource source) const -> std::vector< Interface >
Definition: Domain.hpp:439
Definition: ShutdownFlag.hpp:7
bool openConsole(gsl::czstring<> dev_name, Stream &st, enums::domain::ConsoleFlag flags) noexcept
Definition: Domain.hpp:544
auto getVcpuPinInfo(enums::domain::VCpuFlag flags) -> std::optional< std::vector< unsigned char >>
Definition: Domain.hpp:404
unsigned getID() const noexcept
Definition: Domain.hpp:283
auto interfaceAddressesView(enums::domain::InterfaceAddressesSource source) const noexcept
Definition: Domain.hpp:434
Running
Definition: Decls.hpp:64
Flag
Definition: Decls.hpp:24
bool blockPeek(gsl::czstring<> disk, unsigned long long offset, gsl::span< std::byte > buffer) const noexcept
Definition: Domain.hpp:67
Paused
Definition: Decls.hpp:82
constexpr Domain(virDomainPtr ptr=nullptr) noexcept
Definition: Domain.hpp:16
auto getTime() const noexcept
Definition: Domain.hpp:335
auto getState() const noexcept-> StateWReason
Definition: Domain.hpp:308
std::optional< virDomainControlInfo > getControlInfo() const noexcept
Definition: Domain.hpp:170
bool managedSave(enums::domain::SaveRestoreFlag flag) noexcept
Definition: Domain.hpp:459
bool pinIOThread(unsigned int iothread_id, CpuMap cpumap, enums::domain::ModificationImpactFlag flags) noexcept
Definition: Domain.hpp:560
bool setVcpu(gsl::czstring<> vcpumap, bool state, enums::domain::ModificationImpactFlag flags) noexcept
Definition: Domain.hpp:674
bool injectNMI() noexcept
Definition: Domain.hpp:432
Connection getConnect() const noexcept
Definition: Domain.hpp:163
bool migrateSetMaxSpeed(unsigned long bandwidth, unsigned int flag) noexcept
Definition: Domain.hpp:534
SaveImageXMLFlag
Definition: Decls.hpp:55
bool blockJobSetSpeed(gsl::czstring<> disk, unsigned long bandwidth, enums::domain::BlockJobSetSpeedFlag flags) noexcept
Definition: Domain.hpp:63
bool pinEmulator(CpuMap cpumap, enums::domain::ModificationImpactFlag flags) noexcept
Definition: Domain.hpp:556
bool updateDeviceFlags(gsl::czstring<> xml, enums::domain::DeviceModifyFlag flags) noexcept
Definition: Domain.hpp:694
Definition: Domain.hpp:96
auto getUUID() const
Definition: Domain.hpp:345
bool migrateSetMaxDowntime(unsigned long long downtime) noexcept
Definition: Domain.hpp:530
Definition: Domain.hpp:481
bool setTime(long long seconds, unsigned int nseconds, enums::domain::SetTimeFlag flags) noexcept
Definition: Domain.hpp:666
bool pinVcpuFlags(unsigned int vcpu, CpuMap cpumap, enums::domain::ModificationImpactFlag flags) noexcept
Definition: Domain.hpp:568
bool setMemoryParameters(TypedParams params, enums::domain::ModificationImpactFlag flags) noexcept
Definition: Domain.hpp:641
auto getIOThreadInfo(enums::domain::ModificationImpactFlag flags) const noexcept
Definition: Domain.hpp:231
bool setMetadata(enums::domain::MetadataType type, gsl::czstring<> metadata, gsl::czstring<> key, gsl::czstring<> uri, enums::domain::ModificationImpactFlag flags) noexcept
Definition: Domain.hpp:661
Definition: DestroyFlag.hpp:7
std::optional< JobInfo > getJobInfo() const noexcept
Definition: Domain.hpp:252
unsigned long getMaxMemory() const noexcept
Definition: Domain.hpp:372
auto getSchedulerType() const noexcept-> std::pair< UniqueZstring, int >
Definition: Domain.hpp:289
bool blockRebase(gsl::czstring<> disk, gsl::czstring<> base, unsigned long bandwidth, enums::domain::BlockRebaseFlag flags)
Definition: Domain.hpp:75
Definition: XMLFlags.hpp:7
Shutdown
Definition: Decls.hpp:99
TFE hasManagedSaveImage() const noexcept
Definition: Domain.hpp:430
bool setInterfaceParameters(gsl::czstring<> device, TypedParams params, enums::domain::ModificationImpactFlag flags) noexcept
Definition: Domain.hpp:629
auto getSecurityLabel() const noexcept-> std::unique_ptr< virSecurityLabel >
Definition: Domain.hpp:295
auto getLaunchSecurityInfo() const noexcept
Definition: Domain.hpp:257
Definition: BlockResizeFlag.hpp:7
Definition: DeviceModifyFlag.hpp:7
auto getFSInfo() const noexcept
Definition: Domain.hpp:206
Definition: ModificationImpactFlag.hpp:7
auto extractIOThreadInfo(enums::domain::ModificationImpactFlag flags) const -> std::vector< heavy::IOThreadInfo >
Definition: Domain.hpp:236
bool undefine() noexcept
Definition: Domain.hpp:690
auto getSecurityLabelList() const noexcept
Definition: Domain.hpp:300
bool blockJobAbort(gsl::czstring<> disk, enums::domain::BlockJobAbortFlag flags) noexcept
Definition: Domain.hpp:59
Definition: OpenGraphicsFlag.hpp:7
MemoryFlag
Definition: Decls.hpp:137
Info getInfo() const noexcept
Definition: Domain.hpp:241
JobType
Definition: Decls.hpp:46
Definition: ChannelFlag.hpp:7
bool setIOThreadParams(unsigned int iothread_id, TypedParams params, enums::domain::MITPFlags flags) noexcept
Definition: Domain.hpp:625
bool managedSaveDefineXML(gsl::czstring<> dxml, enums::domain::SaveRestoreFlag flag) noexcept
Definition: Domain.hpp:461
auto getPerfEvents(enums::domain::MITPFlags flags) const noexcept
Definition: Domain.hpp:374
bool resume() noexcept
Definition: Domain.hpp:597
auto getBlockInfo(gsl::czstring<> disk) const noexcept-> std::optional< virDomainBlockInfo >
Definition: Domain.hpp:146
bool setVcpus(unsigned int nvcpus) noexcept
Definition: Domain.hpp:678
auto getSchedulerParameters() const noexcept
Definition: Domain.hpp:378
int openGraphicsFD(unsigned int idx, enums::domain::OpenGraphicsFlag flags) const noexcept
Definition: Domain.hpp:552
bool setNumaParameters(TypedParams params, enums::domain::ModificationImpactFlag flags) noexcept
Definition: Domain.hpp:645
bool setUserPassword(gsl::czstring<> user, gsl::czstring<> password, enums::domain::SetUserPasswordFlag flags) noexcept
Definition: Domain.hpp:670