Commit Graph
54025 Commits
Author SHA1 Message Date
Michal Privoznik 1147fb79b7 virnetsshsession: Don't check for auth callbacks in virNetSSHAuthenticatePassword()
For the VIR_NET_SSH_AUTH_PASSWORD authentication mechanism the
virNetSSHAuthenticatePassword() is called. Inside it,
virAuthGetPasswordPath() is called to obtain password. Firstly
reading from our auth.conf file is attempted and if that fails
then corresponding callback from virConnectAuthCallbackPtr is
called. But virAuthGetPasswordPath() checks whether the callback
is NULL or not. There is no need for
virNetSSHAuthenticatePassword() to check it too. Drop the
duplicate check.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Richrad W.M. Jones <rjones@redhat.com>
2026-05-18 09:58:55 +02:00
Roman Bogorodskiy 49abca296b bhyve: add agent support
Implement QEMU Guest Agent support for bhyve. In bhyve it can configured
using the virtio-console device.

This change covers only two APIs using the agent:

 - DomainQemuAgentCommand -- the most generic one.
 - DomainGetHostname -- extended to support not only DHCP lease source,
   but an agent as well.

It shares the qemu agent implementation with the qemu driver.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-15 18:03:51 +02:00
Roman Bogorodskiy 58086a5d90 qemu: move qemu_agent.c to hypervisor/
To prepare for the qemu agent support for the bhyve driver,
move the implementation from qemu/ to hypervisor. This way
this implementation can be shared across multiple drivers.

The move is mostly mechanical except qemuAgentOpen()
which now accepts the "timeout" argument for the agent timeout.
As the original code used QEMU_DOMAIN_PRIVATE() to access
the agent timeout value, this change allows to make the code
driver-independent.

qemuAgentOpenUnix() is wrapped with #ifndef WIN32 so it does not fail on
mingw.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-15 18:03:51 +02:00
Jedrzej Wasiukiewicz 853ea73945 NEWS: document resctrl energy monitoring
Signed-off-by: Jedrzej Wasiukiewicz <jedrzej.wasiukiewicz@intel.com>
Signed-off-by: Christopher M. Cantalupo <christopher.m.cantalupo@intel.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-15 14:02:24 +02:00
Jedrzej Wasiukiewicz 4e6f997867 qemu: resctrl energy counters via domstats
Added energy reporting from resctrl PERF_PK_MON through domstats:
  cpu.energy.monitor.count=1
  cpu.energy.monitor.0.name=vcpus_0
  cpu.energy.monitor.0.vcpus=0
  cpu.energy.monitor.0.pkg.count=2
  cpu.energy.monitor.0.pkg.0.id=0
  cpu.energy.monitor.0.pkg.0.core_energy=0.000000
  cpu.energy.monitor.0.pkg.0.activity=0.000000
  cpu.energy.monitor.0.pkg.1.id=1
  cpu.energy.monitor.0.pkg.1.core_energy=2.888203
  cpu.energy.monitor.0.pkg.1.activity=1.718601

Changes:
 - Added VIR_DOMAIN_STATS_CPU_ENERGY_MONITOR_* macros to libvirt-domain.h
 - Added qemuDomainGetStatsEnergy() to qemu_driver.c

Signed-off-by: Jedrzej Wasiukiewicz <jedrzej.wasiukiewicz@intel.com>
Signed-off-by: Christopher M. Cantalupo <christopher.m.cantalupo@intel.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-15 14:02:20 +02:00
Jedrzej Wasiukiewicz 615a7bb898 conf: add energytune to domain XML
The new XML element is <energytune> under <cputune> following earlier pattern for
resctrl features (cachetune, memorytune). Energytune doesn't currently support
the "tuning" part, only monitoring. I added it as energytune for consistency with
cache and memory features, keeping all resctrl handling under cputune. This also makes
sense with current resctrl architecture - all monitoring groups are part of an
allocation group.

Changes:
 - Added <energytune> parsing to domain_conf.c
 - Added schema definition in domaincommon.rng
 - Documented the element in formatdomain.rst
 - Added energytune test

Signed-off-by: Jedrzej Wasiukiewicz <jedrzej.wasiukiewicz@intel.com>
Signed-off-by: Christopher M. Cantalupo <christopher.m.cantalupo@intel.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-15 14:02:17 +02:00
Jedrzej Wasiukiewicz 6389d2987e conf: report energy monitoring in host capabilities
Expose PERF_PKG_MON energy monitoring capabilities in the host
capabilities XML.
<energy>
  <monitor maxMonitors='576'>
    <feature name='core_energy'/>
    <feature name='activity'/>
  </monitor>
</energy>

Changes:
 - Add virCapabilitiesFormatEnergy() to emit <energy> XML block
 - Add virCapabilitiesInitEnergy() to init from PERF_PKG_MON info
 - Add <energy> element and energyMonitorFeature to capability.rng
 - Update qemu_driver to support VIR_RESCTRL_MONITOR_TYPE_ENERGY
 - Add virCapsHostEnergy struct

Signed-off-by: Jedrzej Wasiukiewicz <jedrzej.wasiukiewicz@intel.com>
Signed-off-by: Christopher M. Cantalupo <christopher.m.cantalupo@intel.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-15 14:02:14 +02:00
Jedrzej Wasiukiewicz ff54785cb9 util: add PERF_PKG_MON energy monitoring support in virresctrl
Linux 7.0 introduced in resctrl PERF_PKG_MON interface that exposes per-package
energy and performance counters. This patch extends virresctrl implementation
to discover and read energy counters from this new resource type.
(core_energy - Joules, activity - Farads)

Changes:
 - Add Energy features allow-list virResctrlEnergyFeatures
   since PERF_PKG_MON is not prefix-based.
 - Added perf_monitor_info to _virResctrlInfo to contain _virResctrlInfo capabilities
 - New virResctrlGetPerfMonitorInfo following earlier virResctrlGetMonitorInfo
   to check new resource capabilities
 - Added VIR_RESCTRL_MONITOR_TYPE_ENERGY and mapped it to energy allow-list
 - Added dvals/ndvals pair to _virResctrlMonitorStats to support floating-point
   counters and integer counters in single monitor (to support integer perf counters
   in the future).
 - Added floating-point read + parse in virResctrlMonitorGetStats for energy counters
 - Stubbed VIR_RESCTRL_MONITOR_TYPE_ENERGY in qemu_driver

Signed-off-by: Jedrzej Wasiukiewicz <jedrzej.wasiukiewicz@intel.com>
Signed-off-by: Christopher M. Cantalupo <christopher.m.cantalupo@intel.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-15 14:02:10 +02:00
Ján Tomko b0c104e7aa util: virGetSubIDs: do not limit file size
On systems with many users, this file can be larger than BUFSIZ.
Since the file should only be editable by root and virFileReadAll
reallocates the buffer in increments as needed as opposed to
allocating for 'maxlen' upfront, set the maximum to INT_MAX.

https://gitlab.com/libvirt/libvirt/-/work_items/874

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-05-14 23:32:35 +02:00
Ján Tomko a1e5d90277 esx: include viralloc.h for VIR_FREE usage
Fixes: af83ac00eb
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 23:29:00 +02:00
Martin Kletzander af83ac00eb Revert "esx: switch VIR_FREE->g_free in esx*Free*()"
This reverts commit 443c79dd7f.

Change from VIR_FREE() to g_free meant there is a possible double free
when there is an error during parsing because the parsing it done
directly into the parsedUri member of the esxPrivate, free'd when it
fails and then the caller calls free on it again.  Changing back to
VIR_FREE() means there is no double free and no crash.

Reproducible easily with `virsh -c esx://l?no_verify=2`.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2026-05-14 17:52:21 +02:00
Michal Privoznik 77bd314656 cputest: Detect unused files
Use newly introduced testutils APIs to detect unused files.
This is pretty much straightforward, except for one small thing:
some test cases depend on QEMU (and are NOP if built without it).
Hence the condition in testCaseEnumerate().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 14:25:28 +02:00
Michal Privoznik d654789e46 cputestdata: Drop unused files
There are couple of files under tests/cputestdata/ that are not
used by any test case:

1) ppc64-guest-host-model.xml - unused since its introduction in
   v1.2.19-rc1~31
2) ppc64-host+guest-host-model.xml - Same
3) x86_64-bogus-vendor.xml - Introduced in v0.8.7~195 under
   slightly different name, then renamed to the current name (in
   v3.1.0-rc1~3) but never used actually.

Just drop these three files.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 14:25:28 +02:00
Michal Privoznik 7a3f0273b7 networkxmlconftest: Detect unused files
Use newly introduced testutils APIs to detect unused files.
This is pretty much straightforward except for one test case:
hostdev. This test case queries sysfs under the hood and thus is
expected to succeed on Linux and fail everywhere else. Though,
hostdev.expect.xml is thus used on Linux only. Therefore, do not
collect it on non-Linux platforms.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 14:25:28 +02:00
Michal Privoznik ca3c863a1e networkxmlconfdata: Remove passthrough-pf.conf
The passthrough-pf.conf file is not used really, because the test
case is defined as:

  DO_TEST_VALIDATE_ERROR("passthrough-pf");

meaning the test is expected to fail in XML validation phase.
Hence, no .conf file is ever generated for it. Remove the file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 14:25:28 +02:00
Michal Privoznik 5e7265d97c qemuxmlconftest: Switch to virTestEnumerateTestCases()
The qemuxmlconftest detects unused files in qemuxmlconfdata/
directory. But it uses its own implementation for that. But now
that there's a generic implementation available, switch to that.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 14:25:28 +02:00
Michal Privoznik 3d60ba0685 testutils: Introduce unused file detection
This is basically a generalized version of what we have in
qemuxmlconftest (functions testConfXMLEnumerate(),
testQemuConfMarkUsed() and testConfXMLCheck()). The idea is to
reuse the code in other tests.

There's one slight difference to the original - while
qemuxmlconftest always allocated the hash table, in this
generalized version NULL table is okay.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 14:25:28 +02:00
Peter Krempa 942782431b qemuDomainSetIOThreadParams: Move typed parameter validation to top level
This will allow introspecting them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:10 +02:00
Peter Krempa ce92ec2bdb qemuDomainSetSchedulerParameters: Make typed parameters introspectable
For making introspection possible both qemuDomainSetSchedulerParameters
and qemuDomainSetSchedulerParametersFlags need to have the check
present.

Refactor the flag validation to make it present in both APIs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:10 +02:00
Peter Krempa 3281beb957 util: hostmem: Make parameters for 'virHostMemSetParameters' introspectable
Refactor the validation using 'virTypedParamsValidateTemplate' and
export the template so that 'qemuNodeSetMemoryParameters' can expose
them via introspection.

In addition since 'virHostMemSetParameters' is conditionally compiled,
platforms which don't support it will not expose given params.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:10 +02:00
Peter Krempa ccb62a313f qemu: Reimplement 'qemuDomainValidateBlockIoTune' using 'virTypedParamsValidateTemplate'
Make the block io tuning params introspectable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:10 +02:00
Peter Krempa a650af5002 qemu: migration: Use 'virTypedParamsValidateTemplate' for migration params
Refactor the code to use the new helper for validating migration params
and making them later available for introspection.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:10 +02:00
Peter Krempa 4561735158 util: typedparam: Introduce 'virTypedParamsValidateTemplate'
While 'virTypedParamsValidate', which uses varargs to pass the template
to validate parameters against, is convenient for single uses we have
multiple occasions where we want to validate the same list of parameters
in muliple places. We use either a macro which expands to the parameter
list in place or a function which encapsulates the validation.

For introspection of input typed parameters we'll need to have the list
of supported typed parameters in each function which uses them as input
and either of the approaches is inconvenient for generating the
introspection parts.

Refactor 'virTypedParamsValidate', to split the actual validation
internals into ''virTypedParamsValidateInternal' and create two
wrappers:
 - 'virTypedParamsValidate' which uses varargs
 - 'virTypedParamsValidateTemplate' which uses an array of structs
    containing the template.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:10 +02:00
Peter Krempa 366c9935fa qemuDomainGetMetadata: Add top-level flag validation
The implementation uses 'virDomainObjGetMetadata'
internally. To have a top level flag validation for the upcoming flag
introspection export the supported flags as a macro and add a
'virCheckFlags'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:10 +02:00
Peter Krempa 189f1bbec3 qemuConnectDomainQemuMonitorEventRegister: Add top-level flag validation
The implementation uses 'virDomainQemuMonitorEventStateRegisterID'
internally. To have a top level flag validation for the upcoming flag
introspection export the supported flags as a macro and add a
'virCheckFlags'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:10 +02:00
Peter Krempa c86f0e31f5 qemuDomainQemuMonitorCommand: Add top-level flag validation
The implementation uses 'qemuDomainQemuMonitorCommandWithFiles'
internally. To have a top level flag validation for the upcoming flag
introspection export the supported flags as a macro and add a
'virCheckFlags'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:10 +02:00
Peter Krempa 6a0e6a5502 qemuDomainManagedSaveDefineXML: Add top-level flag validation
The implementation for managed save uses 'qemuDomainSaveImageDefineXML'
internally which validates the flags. To have a top level flag
validation for the upcoming flag introspection export the supported
flags as a macro and add a 'virCheckFlags' to
'qemuDomainManagedSaveDefineXML'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:10 +02:00
Peter Krempa 7fbfb59938 qemuDomainDetachDeviceAlias: Move 'flags' validation to top level
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:10 +02:00
Peter Krempa 40629050b5 qemuDomainGetLaunchSecurityInfo: Move flag check to top level
The flag check inside 'qemuDomainGetSEVInfo' makes no sense because it
only validates the 'VIR_TYPED_PARAM_STRING_OKAY' which is not actually
used.

Remove the 'flags parameter from 'qemuDomainGetSEVInfo' and validate
flags at 'qemuDomainGetLaunchSecurityInfo'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:10 +02:00
Peter Krempa c707c1d17d qemu: snapshot: Move flag checks to top level functions
Move the 'virCheckFlags' invocations to the top level driver function so
that they become available for introspection.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:10 +02:00
Peter Krempa ce9b94437c qemuDomainRestore(Flags|Params): Refactor flag checking
Create QEMU_DOMAIN_RESTORE_FLAGS define which collects all the flags
used by either of the implementations of the 'Restore' API and move the
flag checking into the implementation function so that it's available
later for introspection.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:10 +02:00
Peter Krempa 9f6ff63d3b qemu: checkpoint: Move 'virCheckFlags' to top level functions
Move the flag check to the top level to allow programatic introspection
of supported flags.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:10 +02:00
Peter Krempa cf53aafa70 qemu: dump: Move 'virCheckFlags' to top level functions
Move the flag check to the top level to allow programatic introspection
of supported flags.

Extract the supported flags as a macro so that they can be reused in
both coredump APIs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:09 +02:00
Peter Krempa a55ca07c8a qemu: attach/detach device: Move 'virCheckFlags' to top level functions
Move the flag check to the top level to allow programatic introspection
of supported flags.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:09 +02:00
Peter Krempa 227f4570d8 qemu: backup: Move 'virCheckFlags' to top level functions
Move the flag check to the top level to allow programatic introspection
of supported flags.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:09 +02:00
Peter Krempa a5c6aff2c1 virNodeSuspend: Remove unused 'flags'
Remove the unused argument and bump the 'virCheckFlags' calls to the top
level.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:09 +02:00
Peter Krempa f4b5da14b6 virHostMemGet(Stats|Parameters): Remove unused 'flags'
The utility functions which get memory stats don't actually use the
flags. Remove the argument and move the 'virCheckFlags' to driver
implementation.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:09 +02:00
Peter Krempa e8ad1aec1d virHostCPUGet(Map|Stats): Remove unused 'flags'
The utility functions which get CPU map and stats don't actually use the
flags. Remove the argument and move the 'virCheckFlags' to driver
implementation.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:09 +02:00
Peter Krempa 197a368de5 scripts: check-symfile: Allow also symbols in 'readonly' section
Validate also variables exported as 'extern' e.g. from the util
submodule.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:09 +02:00
Peter Krempa 6756e1d193 util: typedparam: Refactor and fix typed param validation
'virTypedParamsValidate' has special logic to handle the internal
VIR_TYPED_PARAM_UNSIGNED type, but unfortunately the implementation of
the error which is reported is flawed as it only updated the
'expecttype' string when the type actually matched. In cases when it
didn't we'd report the following error:

  error: invalid argument: invalid type 'string' for parameter 'poll_shrink', expected '(null)'

To fix it we can re-implement the validation part by using
virTypedParamValidateType simply by adding the VIR_TYPED_PARAM_UNSIGNED
to 'virTypedParameterTypeToString' handling which is now private and
adding logic to allow either one of the unsigned types, which allows us
to use the same function in both cases, simplifying the code.

Fixes: 07652410a7
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:09 +02:00
Peter Krempa acc7c387ee util: typedparam: Unexport virTypedParameterTypeFromString/virTypedParameterTypeToString
The enum handler implementation has already some special values,
upcoming patches will add more so keep the only internal to avoid
surprises.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:09 +02:00
Peter Krempa a8a6fd26dc util: Replace open-coded internals of VIR_TYPED_PARAMS_DEBUG with 'virTypedParamDebugstr'
Replace the internals of the macro by a function so that
'virTypedParameterToString' doesn't need to be exported as it also
adds mappings for values which don't exist in the public API.

This change also prevents a NULL to be passed to string formatters in
case when the caller sends an unknown typed parameter type as we now
also make sure that the type is in range.

Fixes: 54dd75fd97
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:09 +02:00
Peter Krempa 043d809613 util: virTypedParamValidateType: Don't report unknown typed parameter type as '(null)'
If the actual type of the typed parameter is an invalid number the type
checker would still attempt to convert it to a string resulting in an
attempt to print a NULL string. libc saves us from the crash but the
error message is still wrong. Fix it.

Fixes: 54dd75fd97
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:09 +02:00
Peter Krempa 0e35fe608c util: typedparam: Convert VIR_TYPED_PARAM_CHECK_TYPE into a function
Create 'virTypedParamValidateType' which will use the same logic
encapsulated in a function. Use the error message wording from
'virTypedParamsValidate' as it contains less fluff.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:09 +02:00
Peter Krempa ad40d3c822 qemu: driver: Unify coding style
Reformat qemu_driver.c to use the contemporary coding style. It will
help also for the upcoming script for generating list of supported flags
for APIs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:09 +02:00
Peter Krempa cf5b4bbaef remote_protocol-structs: fix mis-aligned 'remote_domain_set_throttle_group_args'
Fixes: a10b3ffebb
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-05-14 12:13:09 +02:00
Denis V. Lunev 1b32fbdfca virStorageSource: note that capacity/allocation/physical are stale caches
These three fields are cached values that do not reflect reality unless
the caller refreshes them. 'allocation' is in addition ultra-unreliable:
any guest write into a previously unallocated part of a sparse image
invalidates it, even right after a refresh.

Document this on the struct so new callers do not trust the values.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-05-12 13:39:23 +02:00
Akash Kulhalli via Devel 19e1dcf860 API/qemu: add async unplug flag to virDomainSetVcpu
Add VIR_DOMAIN_SETVCPU_ASYNC_UNPLUG for virDomainSetVcpu().

Define a dedicated virDomainSetVcpuBehaviour flag type and wire the
new flag through the QEMU driver. As with setvcpus async unplug,
success indicates request acceptance while final completion is
reported by the vcpu-removed event.

Update the API documentation and add virsh support for the async path to
the setvcpu subcommand.

Signed-off-by: Akash Kulhalli <akash.kulhalli@oracle.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-05-12 13:39:07 +02:00
Akash Kulhalli via Devel fb2791327e API/qemu: add async unplug flag to virDomainSetVcpusFlags
Add VIR_DOMAIN_VCPU_ASYNC_UNPLUG for virDomainSetVcpusFlags().

With this flag, success indicates that QEMU accepted the unplug
request, while final completion is reported by the vcpu-removed
event. Rejected requests continue to be reported by the
device-removal-failed event.

Wire the flag through the QEMU driver, document its semantics, and
add virsh support for the async path in the setvcpus subcommand.

Signed-off-by: Akash Kulhalli <akash.kulhalli@oracle.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-05-12 13:39:07 +02:00
Akash Kulhalli via Devel 6f4e3b40a8 qemu: thread async vcpu unplug through internal helpers
Thread an async_unplug flag through the internal QEMU vCPU unplug
helpers.

When set, the unplug path returns after QEMU accepts the device
deletion request and leaves final completion to the existing
DEVICE_DELETED handling routines.

All callers still pass false, so this does not change behaviour yet.

Signed-off-by: Akash Kulhalli <akash.kulhalli@oracle.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-05-12 13:39:07 +02:00