Commit Graph

32756 Commits

Author SHA1 Message Date
Tim Wiederhake
1b05f2e50b Fix typos
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 09:55:48 +02:00
Michal Privoznik
2597296ea6 qemu_capspriv: Drop needless declarations
There are two functions declared in qemu_capspriv.h:
1) virQEMUCapsInitHostCPUModel() which is not used anywhere but
   qemu_capabilities.c,

2) virQEMUCapsSetSEVCapabilities() which is my personal favorite
   but despite that it's never implemented nor called.

Drop them.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2022-06-01 09:45:40 +02:00
Michal Privoznik
12be42ee7e network: Generate TFTP config regardless of DHCP
We already allow users to provide TFTP root path in network XML
and not specify any DHCP. This makes sense, because dnsmasq is
not only DHCP server but also TFTP server and users might have
a DHCP server configured on their own, outside of libvirt's
control and want just the TFTP part.

By moving TFTP config generator out of DHCP generator and calling
it for every IPv4 range, users can finally enable just TFTP.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2026765
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 09:40:40 +02:00
Michal Privoznik
bab462db6e network: Separate DHCP config generator into a function
Generating configuration file for dnsmasq is done in
networkDnsmasqConfContents() which is this big, self-contained
function. Separate at least DHCP part into its own function for
better readability.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 09:40:19 +02:00
Michal Privoznik
314dac422d network: Initialize variables in networkDnsmasqConfContents()
In networkDnsmasqConfContents() there's a for() loop which
initializes some variables in its initialization block. This
makes both the loop() statement and variable declaration block
look needlessly ugly. Speaking of variable declaration, also move
some variables which are used only within blocks into their
respective blocks.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 09:40:07 +02:00
Michal Privoznik
f344005547 lib: Be consistent about vm->pid
The virDomainObj struct has @pid member where the domain's
hypervisor PID is stored (e.g. QEMU/bhyve/libvirt_lxc/... PID).
However, we are not consistent when it comes to shutoff state.
Initially, because virDomainObjNew() uses g_new0() the @pid is
initialized to 0. But when domain is shut off, some functions set
it to -1 (virBhyveProcessStop, virCHProcessStop, qemuProcessStop,
..).

In other places, the @pid is tested to be 0, on some other places
it's tested for being negative and in the rest for being
positive.

To solve this inconsistency we can stick with either value, -1 or
0. I've chosen the latter as it's safer IMO. For instance if by
mistake we'd kill(vm->pid, SIGTERM) we would kill ourselves
instead of init's process group.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2022-06-01 09:35:26 +02:00
Michal Privoznik
b4161c2d42 virDomainInputDefValidate: Validate model
If input device has one of virtio* models set then it has to go
onto virtio bus. Introduce such check into the validator.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2081981
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-05-30 16:30:21 +02:00
Michal Privoznik
bded22e3a7 virDomainInputDefValidate: Reformat
There are some formatting problems with virDomainInputDefValidate().
Reformat it to our standards. Use this opportunity to move error
messages onto a single line.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-05-30 16:30:09 +02:00
Michal Privoznik
14bd5036e4 qemuProcessStop: Don't try to remove QoS on already removed TAP
When cleaning up after stopped domain, one of the things we do is
attempt to clear QoS settings on OVS type interfaces. Well, this
is needless because they were removed just a couple of lines
above. As a result, the attempt fails and a warning is printed
into logs, polluting them needlessly.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/313
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-30 09:14:41 +02:00
Scott Davis
8833b42f3b vircgroupv1: fix null string specifier argument in virCgroupV1ValidatePlacement
Detected by gcc 11 -Wformat-overflow:
../../src/util/vircgroupv1.c: In function ‘virCgroupV1ValidatePlacement’:
../../src/util/virerror.h:176:5: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
  176 |     virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  177 |                          __FUNCTION__, __LINE__, __VA_ARGS__)
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/util/vircgroupv1.c:411:13: note: in expansion of macro ‘virReportError’
  411 |             virReportError(VIR_ERR_INTERNAL_ERROR,
      |             ^~~~~~~~~~~~~~
../../src/util/vircgroupv1.c:412:80: note: format string is defined here
  412 |                            _("Could not find placement for v1 controller %s at %s"),
      |                                                                                ^~

Signed-off-by: Scott Davis <scott.davis@starlab.io>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-26 10:14:49 +02:00
Scott Davis
8cd9065352 remote: fix null string specifier argument in remoteProbeSessionDriverFromBinary
Detected by gcc 11 -Wformat-overflow:
../src/remote/remote_sockets.c: In function ‘remoteProbeSessionDriverFromBinary’:
../src/util/virlog.h:79:5: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
   79 |     virLogMessage(src, VIR_LOG_DEBUG, filename, linenr, funcname, NULL, __VA_ARGS__)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/util/virlog.h:88:5: note: in expansion of macro ‘VIR_DEBUG_INT’
   88 |     VIR_DEBUG_INT(&virLogSelf, __FILE__, __LINE__, __func__, __VA_ARGS__)
      |     ^~~~~~~~~~~~~
../src/remote/remote_sockets.c:187:9: note: in expansion of macro ‘VIR_DEBUG’
  187 |         VIR_DEBUG("Probing driver '%s' via daemon %s", drivers[i], daemonpath);
      |         ^~~~~~~~~
../src/remote/remote_sockets.c:187:51: note: format string is defined here
  187 |         VIR_DEBUG("Probing driver '%s' via daemon %s", drivers[i], daemonpath);
      |                                                   ^~

Signed-off-by: Scott Davis <scott.davis@starlab.io>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-26 10:14:46 +02:00
Scott Davis
8c6fa38efc qemu: fix null string specifier argument in qemuDomainBlockJobAbort
Detected by gcc 11 -Wformat-overflow:
../../src/qemu/qemu_driver.c: In function ‘qemuDomainBlockJobAbort’:
../../src/util/virerror.h:176:5: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
  176 |     virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  177 |                          __FUNCTION__, __LINE__, __VA_ARGS__)
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/qemu/qemu_driver.c:14475:17: note: in expansion of macro ‘virReportError’
14475 |                 virReportError(VIR_ERR_OPERATION_FAILED,
      |                 ^~~~~~~~~~~~~~
../../src/qemu/qemu_driver.c:14476:73: note: format string is defined here
14476 |                                _("block job '%s' failed while pivoting: %s"),
      |                                                                         ^~

Signed-off-by: Scott Davis <scott.davis@starlab.io>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-26 10:14:40 +02:00
Ján Tomko
ad318a6c12 vbox: SnapshotConfAllChildren: reduce scope of tempSize
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-05-25 15:10:02 +02:00
Ján Tomko
9e41a59ce5 apparmor: report error when removing profile failed
Assign the return value to 'rc' before comparing it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-05-25 15:10:02 +02:00
Ján Tomko
ef17772900 Do not check if unsigned vars are less than zero
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-05-25 15:10:02 +02:00
Daniel Henrique Barboza
316de7eb12 cpu_ppc64: add support for host-model on POWER10
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2022-05-24 14:25:41 -03:00
Daniel Henrique Barboza
38dba6a02e cpu_map: add POWER10 cpu model
Add POWER10 as a supported cpu model.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2022-05-24 14:25:41 -03:00
Jiri Denemark
76baf935aa qemu: Do not pass unused opaque pointer to monitor callbacks
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 16:26:04 +02:00
Jiri Denemark
88f3727e71 qemu: Do not use opaque pointer in QEMU monitor callbacks
It always points to QEMU driver, which is quite redundant as all
callbacks also get a pointer to a vm object. Let's get the driver
pointer from there instead.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 16:26:04 +02:00
Jiri Denemark
64d5d06c56 qemu: Drop driver parameter from qemuProcessEventSubmit
We can easily get it from the vm object.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 16:26:04 +02:00
Jiri Denemark
7b5046ff6c qemu: Make vm parameter of qemuProcessEventSubmit mandatory
All callers (QMP event handlers) always pass non-NULL vm pointer. Let's
make the parameter mandatory.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 16:26:04 +02:00
Jiri Denemark
3ccd69f8c0 qemu: Pass arguments to qemuProcessEventSubmit directly
Allocating and filling qemuProcessEvent structure is a repeated pattern
before all calls to qemuProcessEventSubmit. We can move the allocation
inside this function and let callers pass all arguments directly.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 16:26:04 +02:00
Jiri Denemark
b4662bbd1f qemu: Avoid unlocked access to vm object in monitor callbacks
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 16:26:04 +02:00
Michal Privoznik
1c23123732 qemu_tpm: Make APIs work over a single virDomainTPMDef
In qemu_extdevice.c lives code that handles helper daemons that
are required for some types of devices (e.g. virtiofsd,
vhost-user-gpu, swtpm, etc.). These devices have their own
handling code in separate files, with only a very basic functions
exposed (e.g. for starting/stopping helper process, placing it
into given CGroup, etc.). And these functions all work over a
single instance of device (virDomainVideoDef *, virDomainFSDef *,
etc.), except for TPM handling code which takes virDomainDef *
and iterates over it inside its module.

Remove this oddness and make qemuExtTPM*() functions look closer
to the rest of the code.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-24 16:15:29 +02:00
Michal Privoznik
3663a7d48c virprocess: Drop workaround for setns() wrt old glibc
We have our own implementation of setns() which was introduced in
v1.2.9-rc1~190 and extended afterwards. The reason was that back
in 2014 we were dealing with glibc that in some of its older
versions did not provide the function. Mostly for non-intel
arches. Nevertheless, glibc now offers the function for all
architectures we care about (aarch64 being the freshest
architecture where the function was introduced, in glibc-2.17).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-24 16:15:29 +02:00
Andrea Bolognani
7de9b74a84 src: Use archive.org for dead URLs
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 12:19:18 +02:00
Andrea Bolognani
d0a5eb59cb util: Drop references to netlink.pdf
The website no longer exists and the PDF file can't even be
retrieved via archive.org.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 12:19:11 +02:00
Michal Privoznik
2df6849d78 qemu_hotplug: Deny changing @rss and @rss_hash_report attributes of virtio vNICs
We have virDomainUpdateDeviceFlags() API that allows changing of
some attributes of a device whilst domain is still running (e.g.
setting different QoS, link state change on vNICs). But only very
limited set of attributes can be changed and we have to check
whether user isn't trying to sneak in a change that's not
allowed. Well, in case of a virtio vNIC we forgot to check for
@rss and @rss_hash_report attributes of <driver/>.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2082540
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2022-05-24 09:02:00 +02:00
Boris Fiuczynski
e37c39747b nodedev: prevent internal error on dev_busid parse
As "none" is a legal value represented in the sysfs attribute dev_busid
this patch prevents libvirt from incorrectly reporting an internal error.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Suggested-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 08:55:45 +02:00
Daniel Henrique Barboza
8ccb4f463e qemu_capspriv.h: fix indentation
Fix identation of virQEMUCapsUpdateHostCPUModel() params.

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2022-05-23 19:24:28 -03:00
Jiri Denemark
9c495f8fcb qemu: Do not return NULL when qemuMigrationSrcBegin succeeds
My recent commit v8.3.0-201-gc500955e95 tried to fix a regression which
would cause the function to return success even if virCloseCallbacksSet
failed. But due to a strange code flow in the function introduced an
opposite regression. The function would return NULL on success when
called without VIR_MIGRATE_CHANGE_PROTECTION flag.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:59:05 +02:00
Boris Fiuczynski
122b975e40 nodedev: add optional device address of channel device to css device
Add the new introduced sysfs attribute dev_busid which provides the address
of the device in the subchannel independent from the bound device driver.
It is added if available in the sysfs as optional channel_dev_addr element into
the css device capabilty providing the ccw deivce address attributes cssid,
ssid and devno.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:32:35 +02:00
Boris Fiuczynski
e9ba2ced0b schemas: refactor out nodedev ccw address schema
Refactor out nodedev ccw address schema for easy reuse later.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:32:10 +02:00
Boris Fiuczynski
245ff2d663 nodedev: refactor css XML parsing from ccw XML parsing
In preparation for easier extension later.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:32:08 +02:00
Boris Fiuczynski
4402295d37 nodedev: refactor ccw device address parsing from XML
Move ccw device address XML parsing into new method for later reuse.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:32:07 +02:00
Boris Fiuczynski
c586488506 nodedev: refactor css format from ccw format method
In preparation for easier extension later.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:32:03 +02:00
Boris Fiuczynski
9453eb458a util: add virCCWDeviceAddressFromString to virccw
Add a method to parse a ccw device address from a string.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:59 +02:00
Boris Fiuczynski
8d52f99f0b util: add ccw device address parsing into virccw
Add virCCWDeviceAddressParseFromString and use it in nodedev udev.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:57 +02:00
Boris Fiuczynski
2d9fd19bf5 conf: adjust method name virDomainDeviceCCWAddressParseXML
Adjust method name virDomainDeviceCCWAddressParseXML to
virCCWDeviceAddressParseXML.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:55 +02:00
Boris Fiuczynski
784b876035 util: refactor virDomainDeviceCCWAddressEqual into virccw
Refactor virDomainDeviceCCWAddressEqual into virccw and rename method as
virCCWDeviceAddressEqual.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:53 +02:00
Boris Fiuczynski
38756ce5ba util: refactor virDomainDeviceCCWAddressIsValid into virccw
Refactor virDomainDeviceCCWAddressIsValid into virccw and rename method
as virCCWDeviceAddressIsValid.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:52 +02:00
Boris Fiuczynski
be1e16ed11 util: refactor virDomainCCWAddressIncrement into virccw
Refactor virDomainCCWAddressIncrement into virccw and rename method as
virCCWDeviceAddressIncrement.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:49 +02:00
Boris Fiuczynski
5fe90d471a util: refactor ccw address constants into virccw
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:47 +02:00
Boris Fiuczynski
b41163005c util: make reuse of ccw device address format constant
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:45 +02:00
Boris Fiuczynski
1df0a19869 util: refactor virDomainCCWAddressAsString into virccw
Move virDomainCCWAddressAsString into virccw and rename method as
virCCWDeviceAddressAsString.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:42 +02:00
Boris Fiuczynski
45a8e3988f util: refactor virDomainDeviceCCWAddress into virccw.h
Refactor ccw data structure virDomainDeviceCCWAddress into util virccw.h
and rename it as virCCWDeviceAddress.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:40 +02:00
Boris Fiuczynski
78094a4bd1 nodedev: fix reported error msg in css cap XML parsing
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:37 +02:00
Michal Privoznik
a54391fbc2 remote_daemon: Don't run virStateCleanup() if virStateReload() is still running
When a SIGHUP is received a thread is spawned that runs
virStateReload(). However, if SIGINT is received while the former
thread is still running then we may get into problematic
situation: the cleanup code in main() sees drivers initialized
and thus calls virStateCleanup(). So now we have two threads, one
running virStateReload() the other virStateCleanup(). In this
situation it's very likely that a race condition occurs and
either of threads causes SIGSEGV.

To fix this, unmark drivers as initialized in the
virStateReload() thread for the time the function runs.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2075837
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-05-23 14:44:50 +02:00
Andrea Bolognani
2b98d5d91d apparmor: Allow locking AAVMF firmware
We already allow this for OVMF.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/312
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-05-23 14:01:21 +02:00
Jiri Denemark
c500955e95 qemu: Fix error propagation in qemuMigrationBegin
Commit v8.3.0-152-g49ef0f95c6 removed explicit VIR_FREE from
qemuMigrationBegin, effectively reverting v1.2.14-57-g77ddd0bba2

The xml variable was used to hold the return value and thus had to be
unset when an error happened after xml was already non-NULL. Such code
may be quite confusing though and we usually avoid it by not storing
anything to a return variable until everything succeeded.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-05-23 13:13:37 +02:00