]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
2 years agoconf: domain: Refactor cleanup in virSysinfoParseXML
Peter Krempa [Thu, 6 Oct 2022 10:33:08 +0000 (12:33 +0200)] 
conf: domain: Refactor cleanup in virSysinfoParseXML

Use automatic pointer freeing to remove the 'error' label.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: domain: Parse 'type' attribute via virXMLPropEnum in virSysinfoParseXML
Peter Krempa [Thu, 6 Oct 2022 10:30:26 +0000 (12:30 +0200)] 
conf: domain: Parse 'type' attribute via virXMLPropEnum in virSysinfoParseXML

Rewrite the code to use the simple helper.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: domain: Remove pointless XML node name validation in virSysinfoChassisParseXML
Peter Krempa [Thu, 6 Oct 2022 09:12:51 +0000 (11:12 +0200)] 
conf: domain: Remove pointless XML node name validation in virSysinfoChassisParseXML

The only caller passes 'node' argument originating from an XPath lookup
for the 'chassis' element, so there's no point in checking it once more.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: domain: Refactor cleanup in virSysinfoChassisParseXML
Peter Krempa [Thu, 6 Oct 2022 09:20:27 +0000 (11:20 +0200)] 
conf: domain: Refactor cleanup in virSysinfoChassisParseXML

Register automatic cleanup for virSysinfoChassisDef and use it to
refactor the cleanup code paths in virSysinfoChassisParseXML.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: domain: Reformat XPath queries in virSysinfoChassisParseXML
Peter Krempa [Thu, 6 Oct 2022 09:17:17 +0000 (11:17 +0200)] 
conf: domain: Reformat XPath queries in virSysinfoChassisParseXML

Remove the unneeded linebreaks after assignment operator. Only one line
exceeds 80 colums and just by 4 characters.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: domain: Remove pointless XML node name validation in virSysinfoSystemParseXML
Peter Krempa [Thu, 6 Oct 2022 09:12:51 +0000 (11:12 +0200)] 
conf: domain: Remove pointless XML node name validation in virSysinfoSystemParseXML

The only caller passes 'node' argument originating from an XPath lookup
for the 'system' element, so there's no point in checking it once more.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: domain: Refactor cleanup in virSysinfoSystemParseXML
Peter Krempa [Thu, 6 Oct 2022 09:20:27 +0000 (11:20 +0200)] 
conf: domain: Refactor cleanup in virSysinfoSystemParseXML

Register automatic cleanup for virSysinfoSystemDef and use it to
refactor the cleanup code paths in virSysinfoSystemParseXML.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: domain: Reformat XPath queries in virSysinfoSystemParseXML
Peter Krempa [Thu, 6 Oct 2022 09:17:17 +0000 (11:17 +0200)] 
conf: domain: Reformat XPath queries in virSysinfoSystemParseXML

Remove the unneeded linebreaks after assignment operator. Only one line
exceeds 80 colums and just by 4 characters.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: domain: Remove pointless XML node name validation in virSysinfoBIOSParseXML
Peter Krempa [Thu, 6 Oct 2022 09:12:51 +0000 (11:12 +0200)] 
conf: domain: Remove pointless XML node name validation in virSysinfoBIOSParseXML

The only caller passes 'node' argument originating from an XPath lookup
for the 'bios' element, so there's no point in checking it once more.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: domain: Refactor cleanup in virSysinfoBIOSParseXML
Peter Krempa [Thu, 6 Oct 2022 09:09:23 +0000 (11:09 +0200)] 
conf: domain: Refactor cleanup in virSysinfoBIOSParseXML

Register automatic cleanup for virSysinfoBIOSDef and use it to refactor
the cleanup code paths in virSysinfoBIOSParseXML.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: xml: Remove unused virXPathULong*
Peter Krempa [Wed, 5 Oct 2022 15:26:51 +0000 (17:26 +0200)] 
util: xml: Remove unused virXPathULong*

Remove the now-unused functions for parsing 'unsigned long' values via
XPath.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agocpu_arm: Avoid use of 'unsigned long'
Peter Krempa [Wed, 5 Oct 2022 15:20:23 +0000 (17:20 +0200)] 
cpu_arm: Avoid use of 'unsigned long'

Covert all use of 'unsigned long' to 'unsigned long long'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainJobObj: Use 'unsigned int' instead of 'unsigned long' for 'apiFlags' field
Peter Krempa [Wed, 5 Oct 2022 14:54:43 +0000 (16:54 +0200)] 
virDomainJobObj: Use 'unsigned int' instead of 'unsigned long' for 'apiFlags' field

The callers store only an 'unsigned int' in the field. Convert it to the
proper type including parser/formatter.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuDomainObjPrivateXMLParseBlockjobData: Use virXMLPropUInt instead of virXPathULongHex
Peter Krempa [Wed, 5 Oct 2022 14:45:42 +0000 (16:45 +0200)] 
qemuDomainObjPrivateXMLParseBlockjobData: Use virXMLPropUInt instead of virXPathULongHex

Use the function for the proper type.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoppc64ModelParse: Switch to virXMLPropUInt from virXPathULongHex
Peter Krempa [Wed, 5 Oct 2022 14:09:10 +0000 (16:09 +0200)] 
ppc64ModelParse: Switch to virXMLPropUInt from virXPathULongHex

We don't need to do the extra XPath lookups and we can use the proper
type right away.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainSEVDefParseXML: Use virXPathUIntBase instead of virXPathULongHex
Peter Krempa [Wed, 5 Oct 2022 13:54:39 +0000 (15:54 +0200)] 
virDomainSEVDefParseXML: Use virXPathUIntBase instead of virXPathULongHex

Use the proper function for an unsigned int.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainNetDef: Change type of 'tune.sndbuf'
Peter Krempa [Wed, 5 Oct 2022 13:52:59 +0000 (15:52 +0200)] 
virDomainNetDef: Change type of 'tune.sndbuf'

Use 'unsigned long long' instead of 'unsigned long' and fix the parser
and formatter.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainTimerDefParseXML: Use virXMLProp instead of virXPath
Peter Krempa [Mon, 24 Oct 2022 13:24:44 +0000 (15:24 +0200)] 
virDomainTimerDefParseXML: Use virXMLProp instead of virXPath

Parse the 'frequency' field without an extra XPath.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainTimerDef: Convert 'mode' field to proper enum type
Peter Krempa [Mon, 24 Oct 2022 13:20:10 +0000 (15:20 +0200)] 
virDomainTimerDef: Convert 'mode' field to proper enum type

Adjust the parser and switch statements to go with it.

Note that the XEN/libxl drivers had a 'default:' case for few of the
swtich statements so this patch blindly expands it to what it would be
in those cases.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainTimerDef: Convert 'track' field to proper enum type
Peter Krempa [Mon, 24 Oct 2022 13:08:50 +0000 (15:08 +0200)] 
virDomainTimerDef: Convert 'track' field to proper enum type

Adjust the parser and add missing switch cases to make the complier
happy.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainTimerDef: Convert 'tickpolicy' field to proper enum type
Peter Krempa [Mon, 24 Oct 2022 13:05:21 +0000 (15:05 +0200)] 
virDomainTimerDef: Convert 'tickpolicy' field to proper enum type

Convert the field, adjust the XML parser to use virXMLPropEnum and add
the VIR_DOMAIN_TIMER_TICKPOLICY_LAST enum case to all appropriate
'switch' statements.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainTimerDef: Convert 'name' field to proper enum type
Peter Krempa [Mon, 24 Oct 2022 12:58:39 +0000 (14:58 +0200)] 
virDomainTimerDef: Convert 'name' field to proper enum type

Adjust the type and the corresponding parser to use virXMLPropEnum.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainTimerDefParseXML: Refactor cleanup
Peter Krempa [Mon, 24 Oct 2022 12:55:53 +0000 (14:55 +0200)] 
virDomainTimerDefParseXML: Refactor cleanup

Automatically free the 'def' variable and remove the 'cleanup' label.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainTimerCatchupDef: Change members to 'unsigned long long'
Peter Krempa [Wed, 5 Oct 2022 13:47:49 +0000 (15:47 +0200)] 
virDomainTimerCatchupDef: Change members to 'unsigned long long'

The struct used 'unsigned long' variables which we try to avoid due to
being different size on different architectures.

Convert the struct and use virXMLPropULongLong instead of virXPathULong
when parsing the XML.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirNetDevVlanParse: Use virXMLProp* helpers instead of XPath lookups
Peter Krempa [Wed, 5 Oct 2022 13:35:42 +0000 (15:35 +0200)] 
virNetDevVlanParse: Use virXMLProp* helpers instead of XPath lookups

The loop inside virNetDevVlanParse fetches multiple attributes from the
element. Convert it to use the virXMLProp* helpers, which also
simplifies error reporting.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirInterfaceDefParseMtu: Use virXPathUInt instead of virXPathULong
Peter Krempa [Wed, 5 Oct 2022 13:08:50 +0000 (15:08 +0200)] 
virInterfaceDefParseMtu: Use virXPathUInt instead of virXPathULong

Use the proper convertor function and refactor error reporting.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirNetworkIPDefParseXML: Use virXMLPropUInt instead of virXPathULong
Peter Krempa [Wed, 5 Oct 2022 12:43:44 +0000 (14:43 +0200)] 
virNetworkIPDefParseXML: Use virXMLPropUInt instead of virXPathULong

Parse the 'prefix' field directly and adjust the the error message
format strings.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirNetDevIPRouteParseXML: Refactor to use 'virXMLProp*' instead of XPath
Peter Krempa [Wed, 5 Oct 2022 12:33:57 +0000 (14:33 +0200)] 
virNetDevIPRouteParseXML: Refactor to use 'virXMLProp*' instead of XPath

The function extracts multiple attributes form a single element. Modify
the function to stop using multiple XPath lookups.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirQEMUCapsLoadCache: Use 'virXMLPropUInt' instead of 'virXPathULong'
Peter Krempa [Wed, 5 Oct 2022 12:16:46 +0000 (14:16 +0200)] 
virQEMUCapsLoadCache: Use 'virXMLPropUInt' instead of 'virXPathULong'

The libvirt version is stored in an 'unsigned int' use the proper XPath
query function for the type and remove the temporary variable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: xml: Remove virXPathLong
Peter Krempa [Wed, 5 Oct 2022 12:11:10 +0000 (14:11 +0200)] 
util: xml: Remove virXPathLong

The function is now unused and we no longer want to promote use of the
'long' type.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: domain: Convert from virXPathLong
Peter Krempa [Wed, 5 Oct 2022 11:52:07 +0000 (13:52 +0200)] 
conf: domain: Convert from virXPathLong

Convert the two uses of virXPathLong to proper
virXMLPropInt/virXMLPropLongLong so that virXPathLong can be removed in
an upcoming patch.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotestParseNodeInfo: Rewrite to virXPathU(Int|LongLong)
Peter Krempa [Wed, 5 Oct 2022 11:51:45 +0000 (13:51 +0200)] 
testParseNodeInfo: Rewrite to virXPathU(Int|LongLong)

Use the function for appropriate types and simplify the error logic.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: xml: Disallow aliasing of negative numbers in virXPathUInt
Peter Krempa [Wed, 5 Oct 2022 07:56:38 +0000 (09:56 +0200)] 
util: xml: Disallow aliasing of negative numbers in virXPathUInt

Passing negative number as an alias for the max value is an anti-feature
we unfortunately allowed in virsh, but luckily never encouraged in the
XML.

Refuse numbers with negative sign when parsing unsigned int from
XPaths.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirNodeDevCapsDefParseHexId: Use 'virXPathUIntBase'
Peter Krempa [Wed, 5 Oct 2022 07:24:26 +0000 (09:24 +0200)] 
virNodeDevCapsDefParseHexId: Use 'virXPathUIntBase'

Switch to the proper function for parsing integer variant of a hex
number via XPath and spell out properly that the argument is 'unsigned
int'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: xml: Introduce virXPathU(Int|LongLong)Base
Peter Krempa [Wed, 5 Oct 2022 07:17:29 +0000 (09:17 +0200)] 
util: xml: Introduce virXPathU(Int|LongLong)Base

In an effort to remove the 'Long' variants of XPath number fetching
functions we need a way to replace the hex number parsing capability.

The new helpers are created from the originals by adding a 'base'
argument and keeping the original function as a wrapper to pass 10.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: xml: Reimplement virXPath(U)Int via virXPathEvalString
Peter Krempa [Wed, 5 Oct 2022 11:04:17 +0000 (13:04 +0200)] 
util: xml: Reimplement virXPath(U)Int via virXPathEvalString

Similarly to the refactor of virXPath(U)LongLong drop the ability to
convert from the internal double value forcing the use of the 'string()'
conversion.

In case of 32 bit integers there's no problem with overflows, but we can
implement the code identically to what we have in the other helpers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: cpu: Extract and refactor parsing of cache from virCPUDefParseXML
Peter Krempa [Wed, 5 Oct 2022 10:58:30 +0000 (12:58 +0200)] 
conf: cpu: Extract and refactor parsing of cache from virCPUDefParseXML

Move the parser into a helper function named 'virCPUDefParseXMLCache'
and use the virXMLProp* helpers instead of multiple XPath lookups.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: numa: Don't fetch XML node count in virDomainNumatuneParseXML
Peter Krempa [Wed, 5 Oct 2022 10:33:19 +0000 (12:33 +0200)] 
conf: numa: Don't fetch XML node count in virDomainNumatuneParseXML

The code only wants to refuse cases where more than one 'numatune'
element is present which can be achieved by using 'virXPathBoolean'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: node_device: Use 'string()' in XPath expressions for virNodeDevCapsDefParseIntO...
Peter Krempa [Wed, 5 Oct 2022 08:45:04 +0000 (10:45 +0200)] 
conf: node_device: Use 'string()' in XPath expressions for virNodeDevCapsDefParseIntOptional

Upcoming patches will require that the XML XPath query returns a string
for conversion in virXPathInt. Convert all the XPaths used with
virNodeDevCapsDefParseIntOptional which uses virXPathInt internally.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: node_device: Convert rest of virXPathUInt XPath expressions to number
Peter Krempa [Wed, 5 Oct 2022 08:40:04 +0000 (10:40 +0200)] 
conf: node_device: Convert rest of virXPathUInt XPath expressions to number

Convert the rest of the XPath expressions used with virXPathUInt
directly to convert via string(). This will become mandatory in upcoming
patches.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: node_device: Use 'string()' in XPath expressions for virNodeDevCapsDefParseUInt
Peter Krempa [Wed, 5 Oct 2022 08:37:36 +0000 (10:37 +0200)] 
conf: node_device: Use 'string()' in XPath expressions for virNodeDevCapsDefParseUInt

Upcoming patches will require that the XML XPath query returns a string
for conversion in virXPathUInt. Convert all the XPaths used with
virNodeDevCapsDefParseUInt which uses virXPathUInt internally.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: xml: Disallow aliasing of negative numbers in virXPathULongLong
Peter Krempa [Wed, 5 Oct 2022 07:56:38 +0000 (09:56 +0200)] 
util: xml: Disallow aliasing of negative numbers in virXPathULongLong

Passing negative number as an alias for the max value is an anti-feature
we unfortunately allowed in virsh, but luckily never encouraged in the
XML.

Refuse numbers with negative sign when parsing unsigned long long from
XPaths.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: qemucapabilities: Add data for the qemu-7.2 dev cycle
Peter Krempa [Fri, 7 Oct 2022 08:14:55 +0000 (10:14 +0200)] 
tests: qemucapabilities: Add data for the qemu-7.2 dev cycle

Add data based on the v7.1.0-1579-g5107fd3eff qemu commit.

Notable changes:

- New machine types and corresponding objects:
    - pc-i440fx-7.2, pc-i440fx-7.2-machine, pc-q35-7.2, pc-q35-7.2-machine
- new NETDEV_STREAM_CONNECTED/NETDEV_STREAM_DISCONNECTED events
- thread-context object and prealloc-property for memory devices added
- libblkio block driver backed support added:
    - new backend protocol drivers:
       - io_uring, nvme-io_uring, virtio-blk-vhost-user, virtio-blk-vhost-vdpa
- New CPU flags and some CPU features become migratable
  (corresponding 'cpu-host-model' test changed output)
- cpu features 'avx', 'avx2', 'f16c', 'fma', 'vaes' became available in
  TCG
- 'dumpdtb' command added
- New disk frontend properties:
    - account-failed, account-invalid
- New unstable commands for debugging virtio:
  x-query-virtio, x-query-virtio-status, x-query-virtio-queue-status,
  x-query-virtio-vhost-queue-status, x-query-virtio-queue-element

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu_namespace: Make qemuDomainGetPreservedMounts() more robust wrt running VMs
Michal Privoznik [Mon, 31 Oct 2022 15:26:17 +0000 (16:26 +0100)] 
qemu_namespace: Make qemuDomainGetPreservedMounts() more robust wrt running VMs

The aim of qemuDomainGetPreservedMounts() is to get a list of
filesystems mounted under /dev and optionally generate a path for
each one where they are moved temporarily when building the
namespace. And if given domain is also running it looks into its
mount table rather than at the host one. But if it did look at
the domain's private mount table, it find /dev mounted twice: the
first time by udev, the second time the tmpfs mounted by us.

Now, later in the function there's a "sorting" algorithm that
tries to reduce number of mount points needing preservation, by
identifying nested mount points. And if we keep the second
occurrence of /dev on the list, well, after the "sorting" we are
left with nothing but "/dev" because all other mount points are
nested.

Fixes: 46b03819ae8d833b11c2aaccb2c2a0361727f51b
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu_namespace: Don't leak memory in qemuDomainGetPreservedMounts()
Michal Privoznik [Mon, 31 Oct 2022 14:38:13 +0000 (15:38 +0100)] 
qemu_namespace: Don't leak memory in qemuDomainGetPreservedMounts()

The aim of qemuDomainGetPreservedMounts() is to get a list of
filesystems mounted under /dev and optionally generate a path for
each one where they are moved temporarily when building the
namespace. And the function tries to be a bit clever about it.
For instance, if /dev/shm mount point exists, there's no need to
consider /dev/shm/a nor /dev/shm/b as preserving just 'top level'
/dev/shm gives the same result. To achieve this, the function
iterates over the list of filesystem as returned by
virFileGetMountSubtree() and removes the nested ones. However, it
does so in a bit clumsy way: plain VIR_DELETE_ELEMENT() is used
without freeing the string itself. Therefore, if all three
aforementioned example paths appeared on the list, /dev/shm/a and
/dev/shm/b strings would be leaked.

And when I think about it more, there's no real need to shrink
the array down (realloc()). It's going to be free()-d when
returning from the function. Switch to
VIR_DELETE_ELEMENT_INPLACE() then.

Fixes: cdd9205dfffa3aaed935446a41f0d2dd1357c268
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuAppendDomainMemoryMachineParams: Refactor formatting of 'dump-guest-core'
Peter Krempa [Wed, 19 Oct 2022 12:14:33 +0000 (14:14 +0200)] 
qemuAppendDomainMemoryMachineParams: Refactor formatting of 'dump-guest-core'

Use virTristateSwitchFromBool to fill in the default if user didn't
request it explicitly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: xml: Remove double->(u)ll conversion in virXPath(U)LongLong
Peter Krempa [Wed, 5 Oct 2022 07:53:04 +0000 (09:53 +0200)] 
util: xml: Remove double->(u)ll conversion in virXPath(U)LongLong

The conversion from double is not precise enough at the extremes so it
must not be used.

Spell out that the callers are required to use a string() conversion in
the XPath expression and remove the code path handling the direct
conversion from numbers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: xml: Extract XPath evaluation for strings
Peter Krempa [Wed, 5 Oct 2022 07:46:11 +0000 (09:46 +0200)] 
util: xml: Extract XPath evaluation for strings

Extract the internals of virXPathString which evaluate the XPath and
validate that the returned object is a string into a new helper named
'virXPathEvalString'.

The function will be later reused in the number XPath evaluation
functions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: Always use 'string()' conversion with virXPath(U)LongLong
Peter Krempa [Tue, 4 Oct 2022 15:06:14 +0000 (17:06 +0200)] 
conf: Always use 'string()' conversion with virXPath(U)LongLong

When the 'string()' conversion is used the number is parsed inside
libvirt by our internal helpers which work on integers in contrast to
when 'number()' is used and libxml2 uses a 'double' variable internally.

On the upper extremes of the 64 bit variables the double precision
variable doesn't have enough precision to represent each distinct
integer and thus could cause problems.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirNodeDeviceCapPCIDefFormat: Use %u for unsigned values
Peter Krempa [Tue, 4 Oct 2022 14:47:38 +0000 (16:47 +0200)] 
virNodeDeviceCapPCIDefFormat: Use %u for unsigned values

'bus', 'slot' and 'function' are unsigned int variables parsed as
unsigned int, but were formated as signed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: node_device: Rename virNodeDevCapsDefParseULong to virNodeDevCapsDefParseUInt
Peter Krempa [Tue, 4 Oct 2022 14:39:46 +0000 (16:39 +0200)] 
conf: node_device: Rename virNodeDevCapsDefParseULong to virNodeDevCapsDefParseUInt

The function parses an unsigned int so rename it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirNodeDevCapsDefParseULong: Use virXPathUInt instead of virXPathULong
Peter Krempa [Tue, 4 Oct 2022 14:29:33 +0000 (16:29 +0200)] 
virNodeDevCapsDefParseULong: Use virXPathUInt instead of virXPathULong

Fix the function argument to properly spell out 'unsigned int' and use
virXPathUInt instead of virXPathULong and a temporary value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: xml: Remove unused 'virXPathLongHex'
Peter Krempa [Tue, 4 Oct 2022 14:18:16 +0000 (16:18 +0200)] 
util: xml: Remove unused 'virXPathLongHex'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: xml: Use consistent naming for RNG validation error handling functions
Peter Krempa [Tue, 4 Oct 2022 14:09:20 +0000 (16:09 +0200)] 
util: xml: Use consistent naming for RNG validation error handling functions

Rename 'catchRNGError' to 'virXMLValidatorRNGErrorCatch' and
'ignoreRNGError' to 'virXMLValidatorRNGErrorIgnore'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: xml: Ensure proper header style in virxml.c
Peter Krempa [Tue, 4 Oct 2022 14:07:31 +0000 (16:07 +0200)] 
util: xml: Ensure proper header style in virxml.c

Make the file use consistent header formatting and two line spacing
between functions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: xml: Unexport virXMLXPathContextNew
Peter Krempa [Tue, 4 Oct 2022 13:55:01 +0000 (15:55 +0200)] 
util: xml: Unexport virXMLXPathContextNew

The function is now referenced only within util/virxml.c other callers
should not use it directly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: xml: Remove unused virXPathNumber
Peter Krempa [Tue, 4 Oct 2022 13:53:21 +0000 (15:53 +0200)] 
util: xml: Remove unused virXPathNumber

'virXPathNumber' is not used currently, remove it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agostorage|test|vbox: Implement support for validating storage volume XMLs
Peter Krempa [Tue, 18 Oct 2022 12:07:55 +0000 (14:07 +0200)] 
storage|test|vbox: Implement support for validating storage volume XMLs

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2 years agostorage: Add VIR_STORAGE_VOL_CREATE_VALIDATE flag
Peter Krempa [Tue, 18 Oct 2022 11:59:29 +0000 (13:59 +0200)] 
storage: Add VIR_STORAGE_VOL_CREATE_VALIDATE flag

Allow users to request validation of the storage volume XML. Add new
flag and virsh support.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2 years agoconf: storage: Add support for validating storage vol XML to virStorageVolDefParse
Peter Krempa [Tue, 18 Oct 2022 11:47:31 +0000 (13:47 +0200)] 
conf: storage: Add support for validating storage vol XML to virStorageVolDefParse

Introduce the VIR_VOL_XML_PARSE_VALIDATE parser flag and wire it up into
the validator.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2 years agonodedev|test: Implement support for validating node device XMLs
Peter Krempa [Tue, 18 Oct 2022 11:41:04 +0000 (13:41 +0200)] 
nodedev|test: Implement support for validating node device XMLs

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2 years agonodedev: Add VIR_NODE_DEVICE_(CREATE|DEFINE)_XML_VALIDATE flags
Peter Krempa [Tue, 18 Oct 2022 11:19:05 +0000 (13:19 +0200)] 
nodedev: Add VIR_NODE_DEVICE_(CREATE|DEFINE)_XML_VALIDATE flags

The node device APIs which get XML from the user don't yet support XML
validation flags. Introduce virNodeDeviceCreateXMLFlags and
virNodeDeviceDefineXMLFlags with the appropriate flags and add virsh
support for the new flags.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2 years agoconf: node_device: Add 'validate' argument to virNodeDeviceDefParse
Peter Krempa [Tue, 18 Oct 2022 10:34:07 +0000 (12:34 +0200)] 
conf: node_device: Add 'validate' argument to virNodeDeviceDefParse

Allow callers to request XML validation against the schema. All callers
for now pass 'false'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2 years agoschema: cpu: include 'arch' subelement in interleave definition of 'hostcpu'
Peter Krempa [Thu, 13 Oct 2022 16:49:19 +0000 (18:49 +0200)] 
schema: cpu: include 'arch' subelement in interleave definition of 'hostcpu'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoschema: storagepool: Allow interleaving of per-pool custom namespace elements
Peter Krempa [Thu, 13 Oct 2022 16:44:46 +0000 (18:44 +0200)] 
schema: storagepool: Allow interleaving of per-pool custom namespace elements

The custom namespace parameters for 'rbd' and 'netfs' pool types were
not included in the interleave statement.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoschema: nwfilterbinding: Allow interleaving of subelements of 'owner' element
Peter Krempa [Thu, 13 Oct 2022 16:41:44 +0000 (18:41 +0200)] 
schema: nwfilterbinding: Allow interleaving of subelements of 'owner' element

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoschema: nwfilter: Allow interleaving subelements of the top level 'filter' element
Peter Krempa [Thu, 13 Oct 2022 16:40:15 +0000 (18:40 +0200)] 
schema: nwfilter: Allow interleaving subelements of the top level 'filter' element

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoschema: networkport: Allow interleaving of subelements of 'driver' subelement of...
Peter Krempa [Thu, 13 Oct 2022 16:21:30 +0000 (18:21 +0200)] 
schema: networkport: Allow interleaving of subelements of 'driver' subelement of hostdev-pci

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoschema: networkport: Allow interleaving of subelements of 'owner'
Peter Krempa [Thu, 13 Oct 2022 16:20:17 +0000 (18:20 +0200)] 
schema: networkport: Allow interleaving of subelements of 'owner'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoschema: domain: Allow interleaving of 'watchdog' subelements
Peter Krempa [Thu, 13 Oct 2022 16:18:03 +0000 (18:18 +0200)] 
schema: domain: Allow interleaving of 'watchdog' subelements

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoschema: domain: Allow interleaving of <bootloader> and <os>
Peter Krempa [Thu, 13 Oct 2022 15:45:29 +0000 (17:45 +0200)] 
schema: domain: Allow interleaving of <bootloader> and <os>

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoschema: domain: Add the 'type' subelement of the osexe case of 'os' element to interleave
Peter Krempa [Thu, 13 Oct 2022 15:35:30 +0000 (17:35 +0200)] 
schema: domain: Add the 'type' subelement of the osexe case of 'os' element to interleave

The 'type' element was outside of the 'interleave' definition.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoschema: domain: Allow interleaving 'ip' and 'route' sub-elements of interface
Peter Krempa [Thu, 13 Oct 2022 14:38:52 +0000 (16:38 +0200)] 
schema: domain: Allow interleaving 'ip' and 'route' sub-elements of interface

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoschema: domain: Allow interleaving of subelements of disk's 'mirror'
Peter Krempa [Thu, 13 Oct 2022 14:38:23 +0000 (16:38 +0200)] 
schema: domain: Allow interleaving of subelements of disk's 'mirror'

While for now the 'mirror' element is output only, the idea was to allow
it to be used for input too to restore the mirror job if that becomes
the necessity. Allowing interleaving of the subelements can be done
regardless.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoschema: domain: Allow interleaving of subelements of 'memtune'
Peter Krempa [Thu, 13 Oct 2022 14:33:11 +0000 (16:33 +0200)] 
schema: domain: Allow interleaving of subelements of 'memtune'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoschema: domain: Allow interleaving of 'tpm' config elements
Peter Krempa [Thu, 13 Oct 2022 14:32:13 +0000 (16:32 +0200)] 
schema: domain: Allow interleaving of 'tpm' config elements

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoschema: domain: Allow interleaving of PCI controller config elements
Peter Krempa [Thu, 13 Oct 2022 14:13:47 +0000 (16:13 +0200)] 
schema: domain: Allow interleaving of PCI controller config elements

The 'model' and 'target' element can be freely moved around.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoschema: domain: Allow interleaving of character device config elements
Peter Krempa [Thu, 13 Oct 2022 14:03:00 +0000 (16:03 +0200)] 
schema: domain: Allow interleaving of character device config elements

Allow interleaving in the 'qemucdevSrcDef' definition which is shared
by all places using character device as backend.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoPost-release version bump to 8.10.0
Jiri Denemark [Tue, 1 Nov 2022 11:36:50 +0000 (12:36 +0100)] 
Post-release version bump to 8.10.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoRelease of libvirt-8.9.0 v8.9.0
Jiri Denemark [Tue, 1 Nov 2022 11:17:01 +0000 (12:17 +0100)] 
Release of libvirt-8.9.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoNEWS: Mention VIR_DOMAIN_STATS_VM of virConnectGetAllDomainStats
Han Han [Tue, 1 Nov 2022 05:49:12 +0000 (13:49 +0800)] 
NEWS: Mention VIR_DOMAIN_STATS_VM of virConnectGetAllDomainStats

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2 years agoDocument caveats of 'VIR_DOMAIN_STATS_VM' group of statistics
Peter Krempa [Tue, 1 Nov 2022 09:39:16 +0000 (10:39 +0100)] 
Document caveats of 'VIR_DOMAIN_STATS_VM' group of statistics

The original patches adding the functionality neglected to add any form
of documentation for the stats fields returned for this group.

The stats are directly converted from qemu's 'query-stats(-schema)' QMP
command without any further interpretation. The 'query-stats-schema' has
the following disclaimer:

 Note: runtime-collected statistics and their names fall outside QEMU's usual
       deprecation policies.  QEMU will try to keep the set of available data
       stable, together with their names, but will not guarantee stability
       at all costs; the same is true of providers that source statistics
       externally, e.g. from Linux.  For example, if the same value is being
       tracked with different names on different architectures or by different
       providers, one of them might be renamed.  A statistic might go away if
       an algorithm is changed or some code is removed; changing a default
       might cause previously useful statistics to always report 0.  Such
       changes, however, are expected to be rare.

Since libvirt is not doing any form of conversion of the stats we can't
meaningfully document any of the returned fields. At the same time we
can't even meaningfully provide any form of API stability for the field
names.

Modify the documentation for the 'VIR_DOMAIN_STATS_VM' group both in the
API docs and in the virsh man page to reflect that and disclaim any form
of stability guarantees we provide normally.

Fixes: 8c9e3dae142
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoNEWS: Mention the tool virt-qemu-qmp-proxy
Han Han [Tue, 1 Nov 2022 05:49:11 +0000 (13:49 +0800)] 
NEWS: Mention the tool virt-qemu-qmp-proxy

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2 years agoNEWS: Mention UNDEFINE_TPM and UNDEFINE_KEEP_TPM flags
Han Han [Tue, 1 Nov 2022 05:49:10 +0000 (13:49 +0800)] 
NEWS: Mention UNDEFINE_TPM and UNDEFINE_KEEP_TPM flags

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2 years agoinclude: Fix the introduced version of VIR_DOMAIN_STATS_VM
Han Han [Tue, 1 Nov 2022 02:45:08 +0000 (10:45 +0800)] 
include: Fix the introduced version of VIR_DOMAIN_STATS_VM

Fixes: 8c9e3dae14
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2 years agotests: Fix libxlxml2domconfigtest with latest xen
Cole Robinson [Thu, 27 Oct 2022 12:51:25 +0000 (08:51 -0400)] 
tests: Fix libxlxml2domconfigtest with latest xen

shadow_memkb is populated from a libxl API call, and the value can
change. For example:
https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=2c992810854a15b41be920519ce83a4a328d5168

Mock libxl_get_required_shadow_memory to give consistent output

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2 years agodocs: Remind users to remove --timeout option without socket activation v8.9.0-rc2
Martin Kletzander [Wed, 26 Oct 2022 14:19:25 +0000 (16:19 +0200)] 
docs: Remind users to remove --timeout option without socket activation

There is part of our man page that describes how to switch to the
traditional (non-socket) activation but it might still happens sometimes that
there is an extra --timeout option specified for the daemon.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoRemove Before=libvirt-guests.service from other services
Martin Kletzander [Wed, 26 Oct 2022 12:43:39 +0000 (14:43 +0200)] 
Remove Before=libvirt-guests.service from other services

libvirt-guests has After= dependency for all the sockets and that is enough.
With the extra Before= in the service file systemd postpones the start of the
socket activated service (when libvirt-guests is trying to connect to the
socket) until after libvirt-guests is stopped effectively making `systemctl stop
libvirt-guests` deadlock.  The reason for that is that all stop jobs are
scheduled before any start job.  Removing the redundant Before= specification
fixes this behaviour.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoNEWS: Document my contributions for upcoming release
Michal Privoznik [Wed, 26 Oct 2022 08:25:04 +0000 (10:25 +0200)] 
NEWS: Document my contributions for upcoming release

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Wed, 26 Oct 2022 23:20:15 +0000 (01:20 +0200)] 
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10386 of 10386 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/uk/

Co-authored-by: Yuri Chornoivan <yurchor@ukr.net>
Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2 years agoTranslated using Weblate (Korean)
김인수 [Wed, 26 Oct 2022 23:20:14 +0000 (01:20 +0200)] 
Translated using Weblate (Korean)

Currently translated at 100.0% (10386 of 10386 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
2 years agonode_device_driver.h: Drop nodeDeviceLock() and nodeDeviceUnlock() fwd declarations
Michal Privoznik [Tue, 25 Oct 2022 13:56:33 +0000 (15:56 +0200)] 
node_device_driver.h: Drop nodeDeviceLock() and nodeDeviceUnlock() fwd declarations

The node_device_driver.h declares nodeDeviceLock() and
nodeDeviceUnlock() functions which used to exist, but after
rework to automatic mutex management they exist no more. Their
last use was removed in v8.1.0-rc1~122.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2 years agonode_device: Move fwd declaration of udevNodeRegister() into correct header file
Michal Privoznik [Tue, 25 Oct 2022 14:27:14 +0000 (16:27 +0200)] 
node_device: Move fwd declaration of udevNodeRegister() into correct header file

Currently, udevNodeRegister() is forward declared in
node_device_driver.h even though the function is implemented in
node_device_udev.c which warrants node_device_udev.h header file.
Move the declaration into the correct file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2 years agonode_device_udev.h: Drop include of libudev.h
Michal Privoznik [Tue, 25 Oct 2022 08:20:10 +0000 (10:20 +0200)] 
node_device_udev.h: Drop include of libudev.h

Nothing in the header file requires the include of libudev.h, as
the former header file is now empty.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2 years agonode_device: Move DMI_DEVPATH into node_device_udev.c
Michal Privoznik [Tue, 25 Oct 2022 08:19:46 +0000 (10:19 +0200)] 
node_device: Move DMI_DEVPATH into node_device_udev.c

The DMI_DEVPATH macro is used exclusively within
node_device_udev.c. There's no need to expose it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2 years agonode_device_udev.h: Drop unused macro
Michal Privoznik [Tue, 25 Oct 2022 08:04:34 +0000 (10:04 +0200)] 
node_device_udev.h: Drop unused macro

The SYSFS_DATA_SIZE macro is Unused since its introduction in
v0.7.3~48. Sorry Dave.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2 years agoUpdate translation files
Weblate [Tue, 25 Oct 2022 11:11:14 +0000 (13:11 +0200)] 
Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/

Co-authored-by: Weblate <noreply@weblate.org>
Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2 years agoRevert "cgroup/LXC: Do not condition availability of v2 by controllers"
Pavel Hrdina [Tue, 25 Oct 2022 09:34:43 +0000 (11:34 +0200)] 
Revert "cgroup/LXC: Do not condition availability of v2 by controllers"

This reverts commit e49313b54ed2a149c71f9073659222742ff3ffb0.
This reverts commit a0f37232b9c4296ca16955cc625f75eb848ace39.

Revert them together to not break build.

This fix of the issue is incorrect and breaks usage of other controllers
in hybrid mode that systemd creates, specifically usage of devices and
cpuacct controllers as they are now assumed to be part of the cgroup v2
topology which is not true.

We need to find different solution to the issue.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agopo: Refresh potfile for v8.9.0 v8.9.0-rc1
Jiri Denemark [Tue, 25 Oct 2022 11:00:12 +0000 (13:00 +0200)] 
po: Refresh potfile for v8.9.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoci: integration: Bundle only failed Avocado test results
Erik Skultety [Thu, 13 Oct 2022 08:59:08 +0000 (10:59 +0200)] 
ci: integration: Bundle only failed Avocado test results

Latest versions of Avocado create 'by-status' symlink shortcuts to test
results, IOW:

 # this is the main test results directory containing all data
 $ ls <path>/avocado/job-results/latest/test-results/
 01-scripts_networks_050-transient-lifecycle.t
 02-scripts_networks_051-transient-autostart.t
 ...
 22-scripts_networks_400-guest-bandwidth.t
 by_status/

 # list only the failed tests
 $ ls -l <path>/avocado/job-results/latest/test-results/by-status/FAIL
 19-scripts_networks_360-guest-network-vepa.t ->
    <path>/avocado/job-results/latest/test-results/19-scripts_networks_360-guest-network-vepa.t

Therefore, let's bundle only the failed ones, it's going to make the
log artifacts more obvious when looking for libvirt errors.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>