]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
3 years agoqemuxml2argvtest: Add 'LATEST' version of 'misc-no-reboot' test case
Peter Krempa [Mon, 23 Aug 2021 15:09:30 +0000 (17:09 +0200)] 
qemuxml2argvtest: Add 'LATEST' version of 'misc-no-reboot' test case

Upcoming patches will modify how '-no-reboot' is handled when qemu
supports the 'set-action' QMP command. Add a test for it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuDomainAttachWatchdog: Use 'set-action' instead of 'watchdog-set-action' if supported
Peter Krempa [Fri, 20 Aug 2021 12:54:37 +0000 (14:54 +0200)] 
qemuDomainAttachWatchdog: Use 'set-action' instead of 'watchdog-set-action' if supported

If current qemu supports 'set-action' use it instead of the single-use
command.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: monitor: Implement monitor code for 'set-action' command
Peter Krempa [Fri, 20 Aug 2021 12:39:27 +0000 (14:39 +0200)] 
qemu: monitor: Implement monitor code for 'set-action' command

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: capablities: Detect presence of 'set-action' as QEMU_CAPS_SET_ACTION
Peter Krempa [Fri, 20 Aug 2021 10:56:08 +0000 (12:56 +0200)] 
qemu: capablities: Detect presence of 'set-action' as QEMU_CAPS_SET_ACTION

The 'set-action' QMP command allows modifying the behaviour when the
guest resets.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: Honor 'restart' action for 'on_poweroff'
Peter Krempa [Thu, 19 Aug 2021 12:44:51 +0000 (14:44 +0200)] 
qemu: Honor 'restart' action for 'on_poweroff'

We simply terminate qemu instead of issuing a reset as the semantics of
the setting dictate.

Fix it by handling it identically to 'fake reboot'.

We need to forbid the combination of 'onReboot' -> 'destroy' and
'onPoweroff' -> reboot though as the handling would be hairy and it
honetly makes no sense.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: Reject 'preserve' action for 'on_reboot'/'on_poweroff'/'on_crash'
Peter Krempa [Mon, 23 Aug 2021 14:49:11 +0000 (16:49 +0200)] 
qemu: Reject 'preserve' action for 'on_reboot'/'on_poweroff'/'on_crash'

The qemu driver didn't ever implement any meaningful handling for the
'preserve' action.

Forbid the flag in the qemu def validator and update the documentation
to be factual.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: driver: Validate lifecycle actions in 'qemuDomainSetLifecycleAction'
Peter Krempa [Tue, 24 Aug 2021 11:44:00 +0000 (13:44 +0200)] 
qemu: driver: Validate lifecycle actions in 'qemuDomainSetLifecycleAction'

Some actions are not supported by qemu. Use the recently added
'qemuValidateLifecycleAction' helper to ensure that the API does the
same validation as we do on startup in the validation callbacks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: Reject 'rename-restart' action for 'on_reboot'/'on_poweroff'/'on_crash'
Peter Krempa [Thu, 19 Aug 2021 14:23:02 +0000 (16:23 +0200)] 
qemu: Reject 'rename-restart' action for 'on_reboot'/'on_poweroff'/'on_crash'

The qemu driver didn't ever implement any meaningful handling for the
'rename-restart' action.

At this point the following handling would take place:

'on_reboot' set to 'rename-restart' is ignored on guest-initiated
reboots, the guest simply reboots.

For on_poweroff set to 'rename-restart' the following happens:

guest initiated shutdown -> 'destroy'
libvirt initiated shutdown -> 'reboot'

In addition when 'on_reboot' is 'destroy' in addition to 'on_poweroff'
being 'rename-restart' the guest is able to execute instructions after
issuing a reset before libvirt terminates it. This will be addressed
separately later.

Forbid the flag in the qemu def validator and update the documentation
to be factual.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: validate: Reformat header and purge unused includes
Peter Krempa [Tue, 24 Aug 2021 07:26:35 +0000 (09:26 +0200)] 
qemu: validate: Reformat header and purge unused includes

Use the new style header formatting.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: driver: Use 'qemuDomainSaveStatus' for saving status XML
Peter Krempa [Fri, 20 Aug 2021 13:26:47 +0000 (15:26 +0200)] 
qemu: driver: Use 'qemuDomainSaveStatus' for saving status XML

We've got multiple random open-coded versions. Switch to the helper
function which doesn't report errors as they'd be mostly wrong as the
operation was indeed successful.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuDomainSetLifecycleAction: Add a note about argument range-check
Peter Krempa [Fri, 20 Aug 2021 13:17:00 +0000 (15:17 +0200)] 
qemuDomainSetLifecycleAction: Add a note about argument range-check

The public API wrapper range-checks the arguments. Save the next reader
the hassle of looking it up.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuMonitorJSONSetWatchdogAction: Use automatic memory clearing
Peter Krempa [Fri, 20 Aug 2021 12:09:14 +0000 (14:09 +0200)] 
qemuMonitorJSONSetWatchdogAction: Use automatic memory clearing

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuxml2argvtest: Add LATEST version of 'cpu-host-model'
Peter Krempa [Wed, 18 Aug 2021 12:30:10 +0000 (14:30 +0200)] 
qemuxml2argvtest: Add LATEST version of 'cpu-host-model'

This one will be slightly unstable given that CPU features are being
modified frequently in qemu especially when used with a modern cpu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemucapabilitiesdata: Update qemu caps dump for 6.1.0 release
Peter Krempa [Wed, 18 Aug 2021 09:31:48 +0000 (11:31 +0200)] 
qemucapabilitiesdata: Update qemu caps dump for 6.1.0 release

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvtest: Add 'cpu-host-model' cases for all x86-64 real qemu caps versions
Peter Krempa [Wed, 18 Aug 2021 12:28:23 +0000 (14:28 +0200)] 
qemuxml2argvtest: Add 'cpu-host-model' cases for all x86-64 real qemu caps versions

The host model expansion depends on the capability data, so in this case
it makes sense to have specific invocations of the test for all qemu
versions we have.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvtest: Slightly modernize "cpu-host-model" case
Peter Krempa [Wed, 18 Aug 2021 12:21:45 +0000 (14:21 +0200)] 
qemuxml2argvtest: Slightly modernize "cpu-host-model" case

Switch to q35 in anticipation of using DO_TEST_CAPS* in further patches.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvtest: Unify 'cpu-tsc-frequency' and 'cpu-tsc-high-frequency' case
Peter Krempa [Wed, 18 Aug 2021 12:02:36 +0000 (14:02 +0200)] 
qemuxml2argvtest: Unify 'cpu-tsc-frequency' and 'cpu-tsc-high-frequency' case

Use the larger number in the original test to avoid having two files.

Additionally this avoids use of 'host-model' with DO_TEST_CAPS_LATEST in
cases when it isn't necessary for the purpose of the test as the CPU
model tends to change.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvdata: Don't use 'host-model' cpu in 'hugepages-memaccess3'
Peter Krempa [Wed, 18 Aug 2021 11:45:30 +0000 (13:45 +0200)] 
qemuxml2argvdata: Don't use 'host-model' cpu in 'hugepages-memaccess3'

The test case doesn't really test anything about the specific CPU. Using
a host-model cpu with DO_TEST_CAPS_LATEST results in commandline changes
every time qemu updates the cpu definiton.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: add support for '--validate' option in define storage pool
Kristina Hanicova [Tue, 24 Aug 2021 14:51:11 +0000 (16:51 +0200)] 
virsh: add support for '--validate' option in define storage pool

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agostorage_driver & test_driver: allow VIR_STORAGE_POOL_DEFINE_VALIDATE flag
Kristina Hanicova [Tue, 24 Aug 2021 14:51:10 +0000 (16:51 +0200)] 
storage_driver & test_driver: allow VIR_STORAGE_POOL_DEFINE_VALIDATE flag

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agostorage_conf: add validation against schema in pool define
Kristina Hanicova [Tue, 24 Aug 2021 14:51:09 +0000 (16:51 +0200)] 
storage_conf: add validation against schema in pool define

We need to validate the XML against schema if option '--validate'
was passed to the virsh command. This patch also includes
propagation of flags into the virStoragePoolDefParse() function.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoapi: add virStoragePoolDefineFlags
Kristina Hanicova [Tue, 24 Aug 2021 14:51:08 +0000 (16:51 +0200)] 
api: add virStoragePoolDefineFlags

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agolxcxml2xmltest: Substitute 'inactive' variable with 'active'
Kristina Hanicova [Wed, 21 Jul 2021 08:25:22 +0000 (10:25 +0200)] 
lxcxml2xmltest: Substitute 'inactive' variable with 'active'

I removed negation from the name of a variable to make the code
more readable.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoAPI: discourage usage of non-ListAll APIs
Ján Tomko [Sun, 4 Oct 2020 22:20:27 +0000 (00:20 +0200)] 
API: discourage usage of non-ListAll APIs

They require the caller to provide the maximum number
of array elements upfront, leading to either incomplete
results or violations of the zero-one-infinity rule.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agoqemu: simplify machine-type check for implicit floppy controller
Ján Tomko [Fri, 7 May 2021 20:12:43 +0000 (22:12 +0200)] 
qemu: simplify machine-type check for implicit floppy controller

Q35 machine types 2.3 and older had an integrated floppy controller.

Support for these machine types was removed by QEMU commit

  commit 86165b499edf8b03bb2d0e926d116c2f12a95bfe
      q35: Remove old machine versions
  git describe: v2.5.0-1530-g86165b499e contains: v2.6.0-rc0~76^2~4

In libvirt, we have bumped the minimum QEMU version to 2.11:

  commit b4cbdbe90bbf85eaf687f532d5a52a11e664b781
    qemu: Formally deprecate support for qemu < 2.11
  git describe: v7.3.0-13-gb4cbdbe90b contains: v7.4.0-rc1~300

Since this QEMU version only supports Q35 machine versions 2.4+,
remove the code dealing with older ones.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agoqemu: check unlink hint from virQEMUFileOpenAs()
Simon Rowe [Mon, 23 Aug 2021 15:40:48 +0000 (15:40 +0000)] 
qemu: check unlink hint from virQEMUFileOpenAs()

Signed-off-by: Simon Rowe <simon.rowe@nutanix.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoiohelper: skip lseek() and ftruncate() on block devices
Simon Rowe [Mon, 23 Aug 2021 15:40:47 +0000 (15:40 +0000)] 
iohelper: skip lseek() and ftruncate() on block devices

Signed-off-by: Simon Rowe <simon.rowe@nutanix.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirsh: add support for '--validate' option in define network
Kristina Hanicova [Mon, 23 Aug 2021 16:50:14 +0000 (18:50 +0200)] 
virsh: add support for '--validate' option in define network

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agonetwork: allow VIR_NETWORK_DEFINE_VALIDATE flag
Kristina Hanicova [Mon, 23 Aug 2021 16:50:13 +0000 (18:50 +0200)] 
network: allow VIR_NETWORK_DEFINE_VALIDATE flag

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agosrc & network_conf: add validation against schema in define
Kristina Hanicova [Mon, 23 Aug 2021 16:50:12 +0000 (18:50 +0200)] 
src & network_conf: add validation against schema in define

This patch also includes propagation of flags into the
virNetworkDefParse().

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoapi: add virNetworkDefineFlags
Kristina Hanicova [Mon, 23 Aug 2021 16:50:11 +0000 (18:50 +0200)] 
api: add virNetworkDefineFlags

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agosrc: add driver support for networkDefineXMLFlags()
Kristina Hanicova [Mon, 23 Aug 2021 16:50:10 +0000 (18:50 +0200)] 
src: add driver support for networkDefineXMLFlags()

I have added new driver functions which define network with given
flags. I have also replaced definitions of the functions without
flags with function calls to the new ones.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovbox_network: add flags to vboxNetworkDefineCreateXML()
Kristina Hanicova [Mon, 23 Aug 2021 16:50:09 +0000 (18:50 +0200)] 
vbox_network: add flags to vboxNetworkDefineCreateXML()

I need to propagate flags for the next commit.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoapi: add public virNetworkDefineXMLFlags() and remote protocol
Kristina Hanicova [Mon, 23 Aug 2021 16:50:08 +0000 (18:50 +0200)] 
api: add public virNetworkDefineXMLFlags() and remote protocol

This new API allows to define network with given flags.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: capabilities: remove pointless labels
Ján Tomko [Mon, 23 Aug 2021 14:35:02 +0000 (16:35 +0200)] 
qemu: capabilities: remove pointless labels

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
3 years agoqemu: capabilities: use g_auto
Ján Tomko [Mon, 23 Aug 2021 14:20:18 +0000 (16:20 +0200)] 
qemu: capabilities: use g_auto

Where easily possible, declare variables with g_auto to reduce
the amount of calls in cleanup sections.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
3 years agoqemu: refactor virQEMUCapsNewCopy
Ján Tomko [Mon, 23 Aug 2021 14:34:59 +0000 (16:34 +0200)] 
qemu: refactor virQEMUCapsNewCopy

Use g_auto and remove pointless labels.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
3 years agoqemu: refactor virQEMUCapsInit
Ján Tomko [Mon, 23 Aug 2021 14:23:47 +0000 (16:23 +0200)] 
qemu: refactor virQEMUCapsInit

Use g_auto and remove pointless labels.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
3 years agoqemu: refactor virQEMUCapsLoadFile
Ján Tomko [Mon, 23 Aug 2021 14:22:17 +0000 (16:22 +0200)] 
qemu: refactor virQEMUCapsLoadFile

Use g_auto and remove pointless labels.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
3 years agoqemu: refactor virQEMUCapsNewForBinaryInternal
Ján Tomko [Mon, 23 Aug 2021 14:21:18 +0000 (16:21 +0200)] 
qemu: refactor virQEMUCapsNewForBinaryInternal

Use g_auto and remove pointless labels.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
3 years agoconf: snapshot/checkpoint: Rewrite 'AlignDisk' logic to appease clang
Peter Krempa [Mon, 23 Aug 2021 12:14:55 +0000 (14:14 +0200)] 
conf: snapshot/checkpoint: Rewrite 'AlignDisk' logic to appease clang

New clang has a false-positive about value of 'olddisks' being unused
after being set. This is clearly wrong because we want to use
'g_autofree' to clear it later.

While I'm against modifying good code for the sake of bad static
analysis in this case it's not obvious that we depend on the lifetime of
'olddisks' being needed until the end of the function as we store
pointers into it into the hash table and later copy them out.

Rewrite the code by assigning to 'olddisks' earlier and then using
'olddisks' in the loop, so it's clear where the lifetime of the objects
ends, and this should also silence the warning.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovbox_network: fix possible memory leak in vboxNetworkDefineCreateXML()
Kristina Hanicova [Mon, 23 Aug 2021 14:33:41 +0000 (16:33 +0200)] 
vbox_network: fix possible memory leak in vboxNetworkDefineCreateXML()

virNetworkDef was not freed if the function failed in the first
two ifs, causing a possible memory leak.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh-snapshot: Don't leak @then in cmdSnapshotList()
Michal Privoznik [Mon, 23 Aug 2021 12:08:10 +0000 (14:08 +0200)] 
virsh-snapshot: Don't leak @then in cmdSnapshotList()

The variable is used inside a loop in which it's allocated in
each iteration. Bring it inside the loop so that g_autoptr()
kicks in each iteration.

Fixes: 3caa28dc50df7ec215713075d669b20bef6473a2
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: qemuxml2*test: switch to virTestRunLog
Ján Tomko [Fri, 20 Aug 2021 14:34:26 +0000 (16:34 +0200)] 
tests: qemuxml2*test: switch to virTestRunLog

This essentially reverts:
commit ca5c8e1dc7801854d856cfc62f2054ae753a40c3
    qemuxml2argvtest: Avoid conditions in test macro

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: cputests: introduce and use virTestRunLog
Ján Tomko [Fri, 20 Aug 2021 14:29:45 +0000 (16:29 +0200)] 
tests: cputests: introduce and use virTestRunLog

A helper that resets the log before each test and prints
it on failure.

It also takes the return variable as an argument,
so it can be used to eliminate number of branches
the compiler has to consider in the main function.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: cputest: remove unnecessary labels
Ján Tomko [Fri, 20 Aug 2021 14:12:04 +0000 (16:12 +0200)] 
tests: cputest: remove unnecessary labels

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: cputest: use g_autofree
Ján Tomko [Fri, 20 Aug 2021 14:05:08 +0000 (16:05 +0200)] 
tests: cputest: use g_autofree

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: cputest: use g_auto for virCPUDef
Ján Tomko [Fri, 20 Aug 2021 14:00:31 +0000 (16:00 +0200)] 
tests: cputest: use g_auto for virCPUDef

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: cputest: use g_auto for virCPUData
Ján Tomko [Fri, 20 Aug 2021 13:57:56 +0000 (15:57 +0200)] 
tests: cputest: use g_auto for virCPUData

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: cputest: use g_auto for virQEMUCaps
Ján Tomko [Fri, 20 Aug 2021 13:53:48 +0000 (15:53 +0200)] 
tests: cputest: use g_auto for virQEMUCaps

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: use g_auto in cpuTestMakeQEMUCaps
Ján Tomko [Thu, 19 Aug 2021 14:32:35 +0000 (16:32 +0200)] 
tests: use g_auto in cpuTestMakeQEMUCaps

Refactor to use automatic cleanup and remove the goto's.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: monitor: define cleanup function for qemuMonitorCPUModelInfo
Ján Tomko [Thu, 19 Aug 2021 14:32:19 +0000 (16:32 +0200)] 
qemu: monitor: define cleanup function for qemuMonitorCPUModelInfo

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agorpm: Enable numactl on s390x
Michal Privoznik [Thu, 19 Aug 2021 14:24:43 +0000 (16:24 +0200)] 
rpm: Enable numactl on s390x

While s390x doesn't have NUMA nodes it has libnuma which is still
helpful as it parses sysfs for us and kernel emulates NUMA#0.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agovirhostmem: Handle numactl-less build in hugepages allocation/reporting
Michal Privoznik [Thu, 19 Aug 2021 13:54:31 +0000 (15:54 +0200)] 
virhostmem: Handle numactl-less build in hugepages allocation/reporting

When using 'virsh freepages' or 'virsh allocpages' then
virHostMemGetFreePages() or virHostMemAllocPages() is called,
respectively. But the following may happen: libvirt was built
without numactl support and thus a fake NUMA node was constructed
for capabilities, which means that startCell is going to be 0.
But we can't blindly pass startCell = 0 to virNumaGetPageInfo()
nor virNumaSetPagePoolSize() because they would operate over node
specific path (/sys/devices/system/node/nodeX) rather than NUMA
agnostic path (/sys/kernel/mm/hugepages/) and we are not
guaranteed that the former exists (kernel might have been built
without NUMA support).

Resolves:https://bugzilla.redhat.com/show_bug.cgi?id=1978574

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agovirhostmem: Let caller pass max NUMA node to virHostMemAllocPages
Michal Privoznik [Thu, 19 Aug 2021 13:55:19 +0000 (15:55 +0200)] 
virhostmem: Let caller pass max NUMA node to virHostMemAllocPages

In all three cases (LXC, QEMU and VBox drivers) the caller has
access to host capabilities and thus know the maximum NUMA node.
This means, that virHostMemAllocPages() doesn't have to query
it. Querying may fail if libvirt was compiled without numactl
support.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agovirhostmem: Let caller pass max NUMA node to virHostMemGetFreePages
Michal Privoznik [Thu, 19 Aug 2021 13:53:39 +0000 (15:53 +0200)] 
virhostmem: Let caller pass max NUMA node to virHostMemGetFreePages

In all three cases (LXC, QEMU and VBox drivers) the caller has
access to host capabilities and thus know the maximum NUMA node.
This means, that virHostMemGetFreePages() doesn't have to query
it. Querying may fail if libvirt was compiled without numactl
support.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agoconf: Introduce virCapabilitiesHostNUMAGetMaxNode()
Michal Privoznik [Thu, 19 Aug 2021 13:21:41 +0000 (15:21 +0200)] 
conf: Introduce virCapabilitiesHostNUMAGetMaxNode()

This is just a small helper that will be used later.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agotests: virnetdev*: remove unnecessary labels
Ján Tomko [Fri, 20 Aug 2021 13:11:52 +0000 (15:11 +0200)] 
tests: virnetdev*: remove unnecessary labels

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: introduce testVirNetDevBandwidthParse
Ján Tomko [Fri, 20 Aug 2021 13:08:34 +0000 (15:08 +0200)] 
tests: introduce testVirNetDevBandwidthParse

The 'PARSE' macro does not use '#' or '##' directives,
or anything from outside of the macro other than the
cleanup label.

Turn it into a function.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: virnetdevbandwidthtest: use g_auto
Ján Tomko [Fri, 20 Aug 2021 12:58:13 +0000 (14:58 +0200)] 
tests: virnetdevbandwidthtest: use g_auto

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: virnetdevopenvswitch: use g_auto
Ján Tomko [Fri, 20 Aug 2021 12:43:29 +0000 (14:43 +0200)] 
tests: virnetdevopenvswitch: use g_auto

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agobuild: only build virnetdevopenvswitchtest on Linux
Ján Tomko [Fri, 20 Aug 2021 12:56:53 +0000 (14:56 +0200)] 
build: only build virnetdevopenvswitchtest on Linux

Now that it uses virnetdevbandwidthmock which we only
build on Linux.

Fixes: eb55e8a897a8c9d68664daa213b1a76b0cb3c05d
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemublocktest: Add test for creating a qcow2 on top of an luks-encrypted qcow2
Peter Krempa [Fri, 20 Aug 2021 11:25:19 +0000 (13:25 +0200)] 
qemublocktest: Add test for creating a qcow2 on top of an luks-encrypted qcow2

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: block: Use correct format name when formatting overlay of qcow2+luks
Peter Krempa [Fri, 20 Aug 2021 11:26:13 +0000 (13:26 +0200)] 
qemu: block: Use correct format name when formatting overlay of qcow2+luks

A logic bug in the code creating overlays on existing images resulted
into wrongly using "luks" instead of "qcow2" for the backing format if
the backing image is an luks-encrypted qcow2. The special format munging
is needed only for raw luks images.

In practice the impact is not as critical as to use encrypted images in
the backing chain the user must fully describe the backing chain
including backing images to provide encryption keys, which overrides the
metadata recorded in the qcow2 header.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: add support for '--validate' option in define secret
Kristina Hanicova [Fri, 20 Aug 2021 12:30:40 +0000 (14:30 +0200)] 
virsh: add support for '--validate' option in define secret

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agosecret_driver: allow VIR_SECRET_DEFINE_VALIDATE flag
Kristina Hanicova [Fri, 20 Aug 2021 12:30:39 +0000 (14:30 +0200)] 
secret_driver: allow VIR_SECRET_DEFINE_VALIDATE flag

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agosecret_conf: add validation against schema in define
Kristina Hanicova [Fri, 20 Aug 2021 12:30:38 +0000 (14:30 +0200)] 
secret_conf: add validation against schema in define

We need to validate the XML against schema if option '--validate'
was passed to the virsh command. This patch also includes
propagation of flags into the virSecretDefParse() function.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoapi: add virSecretDefineFlags
Kristina Hanicova [Fri, 20 Aug 2021 12:30:37 +0000 (14:30 +0200)] 
api: add virSecretDefineFlags

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: add support for '--validate' option in define interface
Kristina Hanicova [Fri, 20 Aug 2021 11:28:52 +0000 (13:28 +0200)] 
virsh: add support for '--validate' option in define interface

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agosrc: allow validation flag in interface define
Kristina Hanicova [Fri, 20 Aug 2021 11:28:51 +0000 (13:28 +0200)] 
src: allow validation flag in interface define

We need to validate the XML against schema if option 'validate'
was passed to the 'iface-define' virsh command. For that we need
to allow validation flag and propagate flags to parse function.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoconf: add validation and propagate flags into virInterfaceDefParse()
Kristina Hanicova [Fri, 20 Aug 2021 11:28:50 +0000 (13:28 +0200)] 
conf: add validation and propagate flags into virInterfaceDefParse()

We need to know if validation flag is present in order to
validate given XML against schema in virXMLParse().

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoapi: add virInterfaceDefineFlags
Kristina Hanicova [Fri, 20 Aug 2021 11:28:49 +0000 (13:28 +0200)] 
api: add virInterfaceDefineFlags

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: add support for '--validate' option in define nwfilter
Kristina Hanicova [Fri, 20 Aug 2021 11:57:10 +0000 (13:57 +0200)] 
virsh: add support for '--validate' option in define nwfilter

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agonwfilter_driver: allow VIR_NWFILTER_DEFINE_VALIDATE flag
Kristina Hanicova [Fri, 20 Aug 2021 11:57:09 +0000 (13:57 +0200)] 
nwfilter_driver: allow VIR_NWFILTER_DEFINE_VALIDATE flag

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agonwfilter_conf: add validation against schema in define
Kristina Hanicova [Fri, 20 Aug 2021 11:57:08 +0000 (13:57 +0200)] 
nwfilter_conf: add validation against schema in define

This patch also includes propagation of flags into the
virNWFilterDefParse().

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoapi: add virNWFilterDefineFlags
Kristina Hanicova [Fri, 20 Aug 2021 11:57:07 +0000 (13:57 +0200)] 
api: add virNWFilterDefineFlags

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agonwfilter: add nwfilterDefineXMLFlags()
Kristina Hanicova [Fri, 20 Aug 2021 11:57:06 +0000 (13:57 +0200)] 
nwfilter: add nwfilterDefineXMLFlags()

I have added a new driver function which allows to define
nwfilter with given flags. I have also replaced definition of
nwfilterDefineXML() with function call to the new function.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoapi: add public virNWFilterDefineXMLFlags() and remote protocol
Kristina Hanicova [Fri, 20 Aug 2021 11:57:05 +0000 (13:57 +0200)] 
api: add public virNWFilterDefineXMLFlags() and remote protocol

This new API function allows to define nwfilter with given flags.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: use g_auto in qemuTestParseCapabilitiesArch
Ján Tomko [Fri, 20 Aug 2021 11:35:05 +0000 (13:35 +0200)] 
tests: use g_auto in qemuTestParseCapabilitiesArch

Refactor qemuTestParseCapabilitiesArch to use g_auto for cleanup.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agotests: use g_auto in testQemuGetCaps
Ján Tomko [Fri, 20 Aug 2021 11:36:00 +0000 (13:36 +0200)] 
tests: use g_auto in testQemuGetCaps

Refactor testQemuGetCaps to use g_auto for cleanup,
remove the error label and use g_steal_pointer for
the successful return path.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agovirsocket: Don't preserve errno in virSocketRecvFD()
Michal Privoznik [Fri, 20 Aug 2021 08:41:41 +0000 (10:41 +0200)] 
virsocket: Don't preserve errno in virSocketRecvFD()

When setting O_CLOEXEC flag on received FD fails the FD is closed
using VIR_FORCE_CLOSE(). But the call is wrapped in errno save
which is not necessary because VIR_FORCE_CLOSE() preserves  errno
value.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoch: monitor: unref mon->vm before vm
Ján Tomko [Thu, 19 Aug 2021 12:01:26 +0000 (14:01 +0200)] 
ch: monitor: unref mon->vm before vm

Do not access 'mon' after unref'ing it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agosyntax-check: remove _test_script_regex
Ján Tomko [Thu, 19 Aug 2021 12:12:57 +0000 (14:12 +0200)] 
syntax-check: remove _test_script_regex

Commit abab5c47f8060eddf0212084a1d70c4b1e3d92dd incorrectly
assumed we do not have any files that could be affected by

  sc_prohibit_reversed_compare_failure

due to the conditional assignment:

  _test_script_regex ?= \<init\.sh\>

so it removed the check.

Also remove the leftover assignment of test-lib.sh,
since any new code attempting to use the compare function
with reversed arguments should be rejected by review
for using shell instead of C or Python.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agosyntax-check: drop useless useless-if-before-free
Ján Tomko [Thu, 19 Aug 2021 12:01:14 +0000 (14:01 +0200)] 
syntax-check: drop useless useless-if-before-free

With most of new code using g_auto for cleanup, contributors
are used to most of the free fucntions handling NULL gracefully.

Also, despite finding some occurrences in current codebase:
  avoid_if_before_free
  ~/libvirt/src/ch/ch_monitor.c: if (mon->vm)
        virObjectUnref(mon->vm);
  ~/libvirt/src/util/virresctrl.c: if (a_type->masks[cache])
        virBitmapFree(a_type->masks[cache]);
the check passes succesfully, because the script's logic:

  Exit status:
    0   one or more matches
    1   no match
    2   an error

does not play nicely with xargs:

  xargs exits with the following status:
       0      if it succeeds
     123      if any invocation of the command exited with status 1-125

The list of functions is also out of date - e.g. qemuCapsFree has
been renamed since.

This also helps eliminate one more Perl script per our programming
languages strategy: https://libvirt.org/programming-languages.html

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agosyntax-check: replace vc-list-files
Ján Tomko [Thu, 19 Aug 2021 10:48:28 +0000 (12:48 +0200)] 
syntax-check: replace vc-list-files

Directly invoke git ls-tree instead of the wrapper file which also:
* checks for other versioning systems
* prepends the source directory to all output lines

Since there is no srcdir prefix in the output anymore, also drop
the extra 'sed' invocation that removes it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agosyntax-check: use VC_LIST_EXCEPT instead of VC_LIST
Ján Tomko [Thu, 19 Aug 2021 11:32:41 +0000 (13:32 +0200)] 
syntax-check: use VC_LIST_EXCEPT instead of VC_LIST

Three callers were using VC_LIST directly.

This is not wrong, because they exclude the always-excluded
files by only looking for C and/or header files.

But using VC_LIST here prevents switching it to outputting
relative paths.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agosyntax-check: assume we're using git
Ján Tomko [Thu, 19 Aug 2021 12:30:01 +0000 (14:30 +0200)] 
syntax-check: assume we're using git

Meson already checks whether we're using git before running
syntax check. This only affects direct invocation through make.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agofix error in printf format string
Zhenyu Ye [Thu, 19 Aug 2021 12:14:11 +0000 (20:14 +0800)] 
fix error in printf format string

Use %s to print NULLSTR(duri).

Reported-by: Peng Liang <liangpeng10@huawei.com>
Signed-off-by: Zhenyu Ye <yezhenyu2@huawei.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: add test on virNetDevOpenvswitchInterfaceSetQos and virNetDevOpenvswitchInterf...
Jinsheng Zhang [Tue, 17 Aug 2021 04:38:16 +0000 (12:38 +0800)] 
tests: add test on virNetDevOpenvswitchInterfaceSetQos and virNetDevOpenvswitchInterfaceClearQos

Test virNetDevOpenvswitchInterfaceSetQos and
virNetDevOpenvswitchInterfaceClearQos with dryrun method.

Signed-off-by: zhangjl02 <zhangjl02@inspur.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirnetdevopenvswitch: Fix qos cleaning residual on multi interfaces
Jinsheng Zhang [Tue, 17 Aug 2021 04:38:15 +0000 (12:38 +0800)] 
virnetdevopenvswitch: Fix qos cleaning residual on multi interfaces

Warn these error instead of return when removing qos or queues. This will
avoid residual qos clearance on multiple interfaces.

Signed-off-by: zhangjl02 <zhangjl02@inspur.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirnetdevopenvswitch: Introduce virNetDevOpenvswitchInterfaceClearTxQos and virNetDev...
Jinsheng Zhang [Tue, 17 Aug 2021 04:38:14 +0000 (12:38 +0800)] 
virnetdevopenvswitch: Introduce virNetDevOpenvswitchInterfaceClearTxQos and virNetDevOpenvswitchInterfaceClearRxQos

Separate virNetDevOpenvswitchInterfaceClearQos into two steps. When setting
qos, we can set only rx or tx and the other one should be cleared.

Signed-off-by: zhangjl02 <zhangjl02@inspur.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirnetdevopenvswitch: Extract common code block to a single function
Jinsheng Zhang [Tue, 17 Aug 2021 04:38:13 +0000 (12:38 +0800)] 
virnetdevopenvswitch: Extract common code block to a single function

Signed-off-by: zhangjl02 <zhangjl02@inspur.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirnetdevopenvswitch: Extract conversion parameters between virNetDevBandwidth and ovs
Jinsheng Zhang [Tue, 17 Aug 2021 04:38:12 +0000 (12:38 +0800)] 
virnetdevopenvswitch: Extract conversion parameters between virNetDevBandwidth and ovs

Signed-off-by: zhangjl02 <zhangjl02@inspur.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirnetdevopenvswitch: Add vmuuid notes on virNetDevOpenvswitchInterfaceSetQos
Jinsheng Zhang [Tue, 17 Aug 2021 04:38:11 +0000 (12:38 +0800)] 
virnetdevopenvswitch: Add vmuuid notes on virNetDevOpenvswitchInterfaceSetQos

Add vmuuid notes on virNetDevOpenvswitchInterfaceSetQos,
and change vmid to vmuuid.

Signed-off-by: Jinsheng Zhang <zhangjl02@inspur.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: Add missing test cases to vmx2xmltest
Martin Kletzander [Thu, 19 Aug 2021 07:55:53 +0000 (09:55 +0200)] 
tests: Add missing test cases to vmx2xmltest

Commit 42b2f35d36a9e was meant to test all four combinations of
serial-pipe-{server,client}-{app,vm} files, but did only add the files and by
mistake duplicated the tests.  Those were later removed as duplicates, so add
them back in.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: Test BlkioParameters related functions for test driver
Luke Yue [Thu, 19 Aug 2021 10:04:31 +0000 (18:04 +0800)] 
tests: Test BlkioParameters related functions for test driver

Signed-off-by: Luke Yue <lukedyue@gmail.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agotest_driver: Implement virDomainSetBlkioParameters
Luke Yue [Thu, 19 Aug 2021 10:04:30 +0000 (18:04 +0800)] 
test_driver: Implement virDomainSetBlkioParameters

Signed-off-by: Luke Yue <lukedyue@gmail.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agotest_driver: Implement virDomainGetBlkioParameters
Luke Yue [Thu, 19 Aug 2021 10:04:29 +0000 (18:04 +0800)] 
test_driver: Implement virDomainGetBlkioParameters

Signed-off-by: Luke Yue <lukedyue@gmail.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agotests: Drop vmx2xml- prefix for vmx2xml test cases
Michal Privoznik [Wed, 18 Aug 2021 12:35:57 +0000 (14:35 +0200)] 
tests: Drop vmx2xml- prefix for vmx2xml test cases

These XMLs live in a separate directory, there's no need for them
to have a special prefix in addition. Dinding proper file based on
vmx2xmltest.c is also needlessly complicated.

The steps used for mass rename are similar to v4.0.0-rc1~186.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agovmx2xmltest: Deduplicate DO_TEST*() arguments
Michal Privoznik [Wed, 18 Aug 2021 12:30:33 +0000 (14:30 +0200)] 
vmx2xmltest: Deduplicate DO_TEST*() arguments

In majority of DO_TEST() and DO_TEST_FAIL() calls the input vmx
file name is the same as the output XML file. Therefore, it's not
necessary to provide the same string twice. For the rest, where
the output XML file is different we can use symlinks to the
expected output.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>