]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
4 years agoqemu: monitor: Remove handlers for the 'POWERDOWN' event
Peter Krempa [Tue, 20 Jul 2021 08:24:07 +0000 (10:24 +0200)] 
qemu: monitor: Remove handlers for the 'POWERDOWN' event

The qemu process code doesn't register a callback for it so we don't
need to be handling it at all.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agostorage_driver: Unlock object on ACL fail in storagePoolLookupByTargetPath
Peter Krempa [Wed, 21 Jul 2021 09:22:25 +0000 (11:22 +0200)] 
storage_driver: Unlock object on ACL fail in storagePoolLookupByTargetPath

'virStoragePoolObjListSearch' returns a locked and refed object, thus we
must release it on ACL permission failure.

Fixes: 7aa0e8c0cb8
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1984318
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agosyntax-check: Prohibit 'vir' prefix for enum implementations in virsh
Peter Krempa [Tue, 13 Jul 2021 09:52:20 +0000 (11:52 +0200)] 
syntax-check: Prohibit 'vir' prefix for enum implementations in virsh

Avoid potential conflict of enum helpers declared in virsh.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agovirsh-volume: Avoid 'vir' prefix for locally declared VIR_ENUM* helpers
Peter Krempa [Mon, 19 Jul 2021 11:23:29 +0000 (13:23 +0200)] 
virsh-volume: Avoid 'vir' prefix for locally declared VIR_ENUM* helpers

Stuff used in virsh should use 'virsh'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agovirsh-network: Avoid 'vir' prefix for locally declared VIR_ENUM* helpers
Peter Krempa [Mon, 19 Jul 2021 11:23:29 +0000 (13:23 +0200)] 
virsh-network: Avoid 'vir' prefix for locally declared VIR_ENUM* helpers

Stuff used in virsh should use 'virsh'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agovirsh-domain: Avoid 'vir' prefix for locally declared VIR_ENUM* helpers
Peter Krempa [Mon, 19 Jul 2021 11:23:29 +0000 (13:23 +0200)] 
virsh-domain: Avoid 'vir' prefix for locally declared VIR_ENUM* helpers

Stuff used in virsh should use 'virsh'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agovirsh-host: Avoid 'vir' prefix for locally declared VIR_ENUM* helpers
Peter Krempa [Mon, 19 Jul 2021 11:23:29 +0000 (13:23 +0200)] 
virsh-host: Avoid 'vir' prefix for locally declared VIR_ENUM* helpers

Stuff used in virsh should use 'virsh'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agonodedev: fix internal error when no defined mdevs exist
Boris Fiuczynski [Wed, 21 Jul 2021 11:30:00 +0000 (13:30 +0200)] 
nodedev: fix internal error when no defined mdevs exist

Commit e9b534905f4 introduced an error when parsing an empty list
returned from mdevctl.

This occurs e.g. if nodedev-undefine is used to undefine the last
defined mdev which causes the following error messages

 libvirtd[33143]: internal error: Unexpected format for mdevctl response
 libvirtd[33143]: internal error: failed to query mdevs from mdevctl:
 libvirtd[33143]: mdevctl failed to updated mediated devices

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
4 years agoqemuxml2argvmock: drop virQEMUCapsGetKVMSupportsSecureGuest
Pavel Hrdina [Thu, 22 Jul 2021 13:15:18 +0000 (15:15 +0200)] 
qemuxml2argvmock: drop virQEMUCapsGetKVMSupportsSecureGuest

It is actually not needed because in qemuxml2argvtest we preload
domaincapsmock as well.

Reported-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agotests: fix compiling tests with minGW
Pavel Hrdina [Thu, 22 Jul 2021 09:45:38 +0000 (11:45 +0200)] 
tests: fix compiling tests with minGW

We need to mock virQEMUCapsGetKVMSupportsSecureGuest only if compiling
with QEMU otherwise compilation will fail with error:

/usr/lib/gcc/i686-w64-mingw32/11.1.1/../../../../i686-w64-mingw32/bin/ld: tests/libdomaincapsmock.dll.p/domaincapsmock.c.obj: in function `virQEMUCapsGetKVMSupportsSecureGuest':
/builds/libvirt/libvirt/build/../tests/domaincapsmock.c:40: undefined reference to `virQEMUCapsGet'
/usr/lib/gcc/i686-w64-mingw32/11.1.1/../../../../i686-w64-mingw32/bin/ld: /builds/libvirt/libvirt/build/../tests/domaincapsmock.c:41: undefined reference to `virQEMUCapsGet'

Fixes: 248a30c0c0ec2610e8fa2bbbc98da6d06978ad2e
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoci: Halt on sanitizer errors
Tim Wiederhake [Mon, 19 Jul 2021 12:14:20 +0000 (14:14 +0200)] 
ci: Halt on sanitizer errors

The undefined behaviour sanitizer (UBSAN) defaults to merely printing an
error message if it detects undefined behaviour. These error messages often
end up in captured output and do not fail the tests, effectively hiding
the warning. Make the test cases fail to make the issues visible.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agovirFileReadLimFD: Cast maxlen to size_t before adding
Tim Wiederhake [Thu, 22 Jul 2021 08:30:21 +0000 (10:30 +0200)] 
virFileReadLimFD: Cast maxlen to size_t before adding

If the function is called with maxlen equal to `INT_MAX`, adding
one will trigger a signed integer overflow.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoconf: remove unnecessary restore in virDomainSEVDefParseXML
Boris Fiuczynski [Thu, 22 Jul 2021 09:07:42 +0000 (11:07 +0200)] 
conf: remove unnecessary restore in virDomainSEVDefParseXML

Since commit d399a728f4 placed the restore in the right scope the
restore can get removed in virDomainSEVDefParseXML.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoconf: Restore ctxt's node in right scope
Zhenzhong Duan [Thu, 22 Jul 2021 07:44:18 +0000 (15:44 +0800)] 
conf: Restore ctxt's node in right scope

We just found <qemu:commandline> is ignored in our xml. Further debug
shows that ctxt's node pointer isn't restored in virDomainSecDefParseXML(),
which leads to parsing of remaining elements failed.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agogenericxml2xmltest: Refactor DO_TEST_FULL() calls
Kristina Hanicova [Tue, 20 Jul 2021 14:44:08 +0000 (16:44 +0200)] 
genericxml2xmltest: Refactor DO_TEST_FULL() calls

I have added 2 new macros to call tests which are expected to
fail in order to make the code more consistent and readable.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agogenericxml2xmltest: Substitute 'inactive' variable with 'active'
Kristina Hanicova [Wed, 21 Jul 2021 07:57:45 +0000 (09:57 +0200)] 
genericxml2xmltest: Substitute 'inactive' variable with 'active'

Having negation in a name of a bool variable seems a bit
confusing to me. I think the substitution makes the code much
more readable.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: Fix error code for SEV launchSecurity unsupported
Boris Fiuczynski [Fri, 16 Jul 2021 09:44:35 +0000 (11:44 +0200)] 
qemu: Fix error code for SEV launchSecurity unsupported

When SEV is not supported but specified in the domain XML by a user it
should not result in an internal error (VIR_ERR_INTERNAL_ERROR)
therefore switching to XML error (VIR_ERR_CONFIG_UNSUPPORTED).

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoqemu: Use common id lsec0 for launchSecurity
Boris Fiuczynski [Fri, 16 Jul 2021 09:44:34 +0000 (11:44 +0200)] 
qemu: Use common id lsec0 for launchSecurity

Use the common id 'lsec0' for all launchSecurity types in the QEMU
command line construction.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agodocs: Add s390-pv in domain capabilities documentation
Boris Fiuczynski [Fri, 16 Jul 2021 09:44:33 +0000 (11:44 +0200)] 
docs: Add s390-pv in domain capabilities documentation

Add documentation for domain capability s390-pv.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoconf: Add availability of s390-pv in domain capabilities
Boris Fiuczynski [Fri, 16 Jul 2021 09:44:32 +0000 (11:44 +0200)] 
conf: Add availability of s390-pv in domain capabilities

Adding availability of s390-pv in domain capabilities and adjust tests.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agodocs: Add s390-pv documentation
Boris Fiuczynski [Fri, 16 Jul 2021 09:44:31 +0000 (11:44 +0200)] 
docs: Add s390-pv documentation

Add documentation for launch security type s390-pv.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoconf: Add s390-pv as launch security type
Boris Fiuczynski [Wed, 21 Jul 2021 11:17:40 +0000 (13:17 +0200)] 
conf: Add s390-pv as launch security type

Add launch security type 's390-pv' as well as some tests.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoqemu: Add s390-pv-guest capability
Boris Fiuczynski [Fri, 16 Jul 2021 09:44:29 +0000 (11:44 +0200)] 
qemu: Add s390-pv-guest capability

Add s390-pv-guest capability.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoconf: Refactor launch security to allow more types
Boris Fiuczynski [Wed, 21 Jul 2021 11:07:51 +0000 (13:07 +0200)] 
conf: Refactor launch security to allow more types

Adding virDomainSecDef for general launch security data
and moving virDomainSEVDef as an element for SEV data.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoqemu: Make KVMSupportsSecureGuest capability available
Boris Fiuczynski [Fri, 16 Jul 2021 09:44:27 +0000 (11:44 +0200)] 
qemu: Make KVMSupportsSecureGuest capability available

Expose existing KVMSupportsSecureGuest capability.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoconf: Rework SEV XML parse and format methods
Boris Fiuczynski [Fri, 16 Jul 2021 09:44:26 +0000 (11:44 +0200)] 
conf: Rework SEV XML parse and format methods

Make use of virDomainLaunchSecurity enum.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoschemas: Refactor launch security
Boris Fiuczynski [Fri, 16 Jul 2021 09:44:25 +0000 (11:44 +0200)] 
schemas: Refactor launch security

Change launch security to make it reusable for other types.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoqemu_migration: Unregister close callback only if connection still exists
Michal Privoznik [Tue, 20 Jul 2021 15:21:34 +0000 (17:21 +0200)] 
qemu_migration: Unregister close callback only if connection still exists

When doing a peer-to-peer migration it may happen that the
connection to the destination disappears. If that happens,
there's no point in trying to unregister the close callback
because the connection is closed already. It results only in
polluting logs with this message:

  error : virNetSocketReadWire:1814 : End of file while reading data: : Input/output error

and the reason for that is unregistering a connection callback
results in RPC (among other things).

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1918211
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
4 years agovirIdentityEnsureSystemToken: Fix error message
Tim Wiederhake [Tue, 20 Jul 2021 15:02:31 +0000 (17:02 +0200)] 
virIdentityEnsureSystemToken: Fix error message

This appears to be a copy-paste mistake from the check directly above.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agomeson: disable bogus warnings from sanitizers on Fedora
Daniel P. Berrangé [Mon, 19 Jul 2021 18:16:59 +0000 (19:16 +0100)] 
meson: disable bogus warnings from sanitizers on Fedora

When building with sanitizers on Fedora we get a wierd error
message

In file included from /usr/include/string.h:519,
                 from ../src/internal.h:28,
                 from ../src/util/virsocket.h:21,
                 from ../src/util/virsocketaddr.h:21,
                 from ../src/util/virnetdevip.h:21,
                 from ../src/util/virnetdevip.c:21:
In function ‘memcpy’,
    inlined from ‘virNetDevGetifaddrsAddress’ at ../src/util/virnetdevip.c:702:13,
    inlined from ‘virNetDevIPAddrGet’ at ../src/util/virnetdevip.c:754:16:
/usr/include/bits/string_fortified.h:29:10: error: ‘__builtin_memcpy’ offset [2, 27] from the object at ‘addr’ is out of the bounds of referenced subobject ‘ss_family’ with type ‘short unsigned int’ at offset 0 [-Werror=array-bounds]
   29 |   return __builtin___memcpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   30 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/bits/socket.h:175,
                 from /usr/include/sys/socket.h:33,
                 from ../src/util/virsocket.h:66,
                 from ../src/util/virsocketaddr.h:21,
                 from ../src/util/virnetdevip.h:21,
                 from ../src/util/virnetdevip.c:21:
../src/util/virnetdevip.c: In function ‘virNetDevIPAddrGet’:
/usr/include/bits/socket.h:193:5: note: subobject ‘ss_family’ declared here
  193 |     __SOCKADDR_COMMON (ss_);    /* Address family, etc.  */
      |     ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

The code is correct, and this only happens when building at -O2.

The docs for -Warray-bounds say that a value of "2" is known to
be liable to generate false positives. Rather than downgrade the
check everywhere, we do it selectively for sanitizers.

Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agogenericxml2xmltest: Modify cachetune test to include id
Kristina Hanicova [Tue, 20 Jul 2021 12:58:09 +0000 (14:58 +0200)] 
genericxml2xmltest: Modify cachetune test to include id

I changed DO_TEST_DIFFERENT to DO_TEST, which allows us to remove
the duplicate out file. I also added id attribute for domain
element in order to parse it as a live XML ('cachetune id' is in
the output of only live XMLs). Lastly I added id of cachetune to
test its output value.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agodocs: Allow 'id' attribute for 'cachetune' element
Kristina Hanicova [Tue, 20 Jul 2021 12:58:08 +0000 (14:58 +0200)] 
docs: Allow 'id' attribute for 'cachetune' element

Even though 'id' attribute is output-only, we should accept xml
files containing it.

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

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agodocs: add kbase article on how to configure core dumps for QEMU
Daniel P. Berrangé [Tue, 20 Jul 2021 12:11:50 +0000 (13:11 +0100)] 
docs: add kbase article on how to configure core dumps for QEMU

Enabling core dumps is a reasonably straightforward task, but is not
documented clearly. This page provides as easy link to point users
to when they need to debug QEMU.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agotestQemuGetLatestCaps: Remove superfluous `goto`s
Tim Wiederhake [Mon, 5 Jul 2021 14:22:49 +0000 (16:22 +0200)] 
testQemuGetLatestCaps: Remove superfluous `goto`s

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agotestQemuGetLatestCaps: Use automatic memory management
Tim Wiederhake [Mon, 5 Jul 2021 14:22:08 +0000 (16:22 +0200)] 
testQemuGetLatestCaps: Use automatic memory management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agotestQemuGetLatestCaps: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 14:21:04 +0000 (16:21 +0200)] 
testQemuGetLatestCaps: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoqemuMonitorJSONGetAllBlockJobInfo: Remove superfluous `goto`s
Tim Wiederhake [Mon, 5 Jul 2021 14:17:55 +0000 (16:17 +0200)] 
qemuMonitorJSONGetAllBlockJobInfo: Remove superfluous `goto`s

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoqemuMonitorJSONGetAllBlockJobInfo: Use automatic memory management
Tim Wiederhake [Mon, 5 Jul 2021 14:17:09 +0000 (16:17 +0200)] 
qemuMonitorJSONGetAllBlockJobInfo: Use automatic memory management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoqemuMonitorJSONGetAllBlockJobInfo: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 14:09:55 +0000 (16:09 +0200)] 
qemuMonitorJSONGetAllBlockJobInfo: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoqemuMonitorGetPRManagerInfo: Remove superfluous `goto`s
Tim Wiederhake [Mon, 5 Jul 2021 14:06:35 +0000 (16:06 +0200)] 
qemuMonitorGetPRManagerInfo: Remove superfluous `goto`s

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoqemuMonitorGetPRManagerInfo: Use automatic memory management
Tim Wiederhake [Mon, 5 Jul 2021 14:05:52 +0000 (16:05 +0200)] 
qemuMonitorGetPRManagerInfo: Use automatic memory management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoqemuMonitorGetPRManagerInfo: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 14:04:59 +0000 (16:04 +0200)] 
qemuMonitorGetPRManagerInfo: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoqemuStateInitialize: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 14:19:14 +0000 (16:19 +0200)] 
qemuStateInitialize: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoqemu: migration: Use correct flag when preparing block dirty bitmaps
Jim Fehlig [Fri, 16 Jul 2021 15:09:37 +0000 (09:09 -0600)] 
qemu: migration: Use correct flag when preparing block dirty bitmaps

qemuMigrationSrcRunPrepareBlockDirtyBitmaps receives the flags parameter
from qemuMigrationSrcRun, where flags are based on the main API enum
values. Similar to commit f58349c9c6, use the main API enum instead of
internal driver enum when checking flags in
qemuMigrationSrcRunPrepareBlockDirtyBitmaps.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoqemu: Signal domain condition in qemuProcessStop a bit later
Jiri Denemark [Fri, 16 Jul 2021 13:52:50 +0000 (15:52 +0200)] 
qemu: Signal domain condition in qemuProcessStop a bit later

Signaling the condition before vm->def->id is reset to -1 is dangerous:
in case a waiting thread wakes up, it does not see anything interesting
(the domain is still marked as running) and just enters virDomainObjWait
where it waits forever because the condition will never be signalled
again.

Originally it was impossible to get into such situation because the vm
object was locked all the time between signaling the condition and
resetting vm->def->id, but after commit 860a999802 released in 6.8.0,
qemuDomainObjStopWorker called in qemuProcessStop between
virDomainObjBroadcast and setting vm->def->id to -1 unlocks the vm
object giving other threads a chance to wake up and possibly hang.

In real world, this can be easily reproduced by killing, destroying, or
just shutting down (from the guest OS) a domain while it is being
migrated somewhere else. The migration job would never finish.

So let's make sure we delay signaling the domain condition to the point
when a woken up thread can detect the domain is not active anymore.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirThreadPoolNewFull: Prevent expanding worker pool by zero
Tim Wiederhake [Fri, 9 Jul 2021 13:09:10 +0000 (15:09 +0200)] 
virThreadPoolNewFull: Prevent expanding worker pool by zero

On libvirtd startup, the list of priority worker threads is uninitialized
(`pool->prioWorkers` is NULL), and then "expanded" to zero (`prioWorkers`)
entries.

This causes `virThreadPoolExpand` to call `VIR_EXPAND_N` on a null pointer
and an increment of zero. The zero increment triggers `virReallocN` to not
actually allocate any memory and leave the pointer NULL, which, eventually,
causes `memset(NULL, 0, 0)` to be called in `virExpandN`.

`memset` is declared `__attribute__ ((__nonnull__ 1))`, which triggers the
following warning when libvirt is compiled with address sanitizing enabled:

    $ meson -Dbuildtype=debug -Db_lundef=false -Db_sanitize=address,undefined
    build && ninja -C build
    $ ./build/run build/src/libvirtd
    src/util/viralloc.c:82:5: runtime error: null pointer passed as
    argument 1, which is declared to never be null

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoviralloc: Delete VIR_INSERT_ELEMENT_COPY and VIR_INSERT_ELEMENT_COPY_INPLACE
Tim Wiederhake [Thu, 8 Jul 2021 12:25:51 +0000 (14:25 +0200)] 
viralloc: Delete VIR_INSERT_ELEMENT_COPY and VIR_INSERT_ELEMENT_COPY_INPLACE

There are no users left.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirQEMUCapsGetMachineTypesCaps: Use GPtrArray
Tim Wiederhake [Thu, 8 Jul 2021 11:10:38 +0000 (13:10 +0200)] 
virQEMUCapsGetMachineTypesCaps: Use GPtrArray

This simplyfies the code a bit and removes one "goto", one "VIR_FREE",
and one "VIR_INSERT_ELEMENT_COPY".

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agotest_driver: Implement virDomainGetControlInfo and add test
Luke Yue [Tue, 13 Jul 2021 12:21:32 +0000 (20:21 +0800)] 
test_driver: Implement virDomainGetControlInfo and add test

As test driver won't have real background job running, in order to get
all possible states, the time is used here to decide which state to be
returned. The default time will get `ok` as return value.

Note that using `virsh domtime fc4 200` won't take effect for the test
driver, to get other states, you have to enter virsh interactive
terminal and set time.

Signed-off-by: Luke Yue <lukedyue@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: Fix crash in virQEMUCapsProbeQMPTPM
Peter Krempa [Mon, 12 Jul 2021 12:55:42 +0000 (14:55 +0200)] 
qemu: Fix crash in virQEMUCapsProbeQMPTPM

If the queried QMP command doesn't exist qemuMonitorGetTPMModels returns
0 but sets the string list to NULL which isn't accepted by
g_strv_contains.

Fixes: a5bc5f0ecf8
Reported-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agovirsh: allow nodedev-list --all --tree
Jonathon Jongsma [Wed, 7 Jul 2021 21:29:29 +0000 (16:29 -0500)] 
virsh: allow nodedev-list --all --tree

Allow the tree view with --all so that we can see all inactive mdevs in
a tree structure nested under their parent devices.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agonodedev: fix parent device of inactive mdevs
Jonathon Jongsma [Wed, 7 Jul 2021 21:29:28 +0000 (16:29 -0500)] 
nodedev: fix parent device of inactive mdevs

Inactive mdevs were simply formatting their parent name as the value
received from mdevctl rather than looking up the libvirt nodedev name of
the parent device. This resulted in a parent value of e.g.
'0000:5b:00.0' instead of 'pci_0000_5b_00_0'. This prevented defining a
new mdev device from the output of nodedev-dumpxml.

Unfortunately, it's not simple to fix this comprehensively due to the
fact that mdevctl supports defining (inactive) mdevs for parent devices
that do not actually exist on the host (yet). So for those persistent
mdev definitions that do not have a valid parent in the device list, the
parent device will be set to the root "computer" device.

Unfortunately, because the value of the 'parent' field now depends on
the configuration of the host, the mdevctl parsing test will output
'computer' for all test devices. Fixing this would require a more
extensive mock test environment.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1979761
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirNWFilterDHCPSnoopInit: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 08:23:19 +0000 (10:23 +0200)] 
virNWFilterDHCPSnoopInit: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNWFilterBuildAll: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 08:16:42 +0000 (10:16 +0200)] 
virNWFilterBuildAll: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNWFilterBindingObjListNew: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 08:15:45 +0000 (10:15 +0200)] 
virNWFilterBindingObjListNew: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNWFilterBindingDefForNet: Remove superfluous `goto`s
Tim Wiederhake [Tue, 6 Jul 2021 08:14:59 +0000 (10:14 +0200)] 
virNWFilterBindingDefForNet: Remove superfluous `goto`s

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNWFilterBindingDefForNet: Use automatic memory management
Tim Wiederhake [Tue, 6 Jul 2021 08:14:10 +0000 (10:14 +0200)] 
virNWFilterBindingDefForNet: Use automatic memory management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNWFilterBindingDefForNet: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 08:12:39 +0000 (10:12 +0200)] 
virNWFilterBindingDefForNet: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNWFilterBindingDefCopy: Remove superfluous `goto`s
Tim Wiederhake [Tue, 6 Jul 2021 11:45:47 +0000 (13:45 +0200)] 
virNWFilterBindingDefCopy: Remove superfluous `goto`s

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNWFilterBindingDefCopy: Use automatic memory management
Tim Wiederhake [Tue, 6 Jul 2021 08:11:19 +0000 (10:11 +0200)] 
virNWFilterBindingDefCopy: Use automatic memory management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNWFilterBindingDefCopy: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 08:07:39 +0000 (10:07 +0200)] 
virNWFilterBindingDefCopy: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoconf: Add AUTOPTR_CLEANUP_FUNC for virNWFilterBindingDef
Tim Wiederhake [Tue, 6 Jul 2021 08:10:23 +0000 (10:10 +0200)] 
conf: Add AUTOPTR_CLEANUP_FUNC for virNWFilterBindingDef

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agonetwork: Allow adding DNS entries sharing hostname for multiple addreses
Peter Krempa [Wed, 14 Jul 2021 10:58:12 +0000 (12:58 +0200)] 
network: Allow adding DNS entries sharing hostname for multiple addreses

Having multiple addresses having same hostname is a common config either
to have IPv4 and IPv6 address for the same hostname or even for DNS
round robin. The validation in the network update code didn't allow
adding such entries despite the fact that it is possible to define a
network with them.

Don't check hostname duplicity when adding a DNS entry.

The update of the test case adds another entry for the 'pudding'
hostname which is added in one of the networkxml2xmlupdate test cases.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agonetworkxml2xmltest: Add example of multiple addresses having the same hostname
Peter Krempa [Wed, 14 Jul 2021 07:20:18 +0000 (09:20 +0200)] 
networkxml2xmltest: Add example of multiple addresses having the same hostname

Having multiple addresses for the same hostname is a legitimate
configuration in DNS. Add test data to cover this case.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: capabilities: fill in domcaps <memoryBacking>
Kristina Hanicova [Thu, 15 Jul 2021 12:18:05 +0000 (14:18 +0200)] 
qemu: capabilities: fill in domcaps <memoryBacking>

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoconf: domcaps: Report <memoryBacking>
Kristina Hanicova [Thu, 15 Jul 2021 12:18:04 +0000 (14:18 +0200)] 
conf: domcaps: Report <memoryBacking>

We need to report via domcapabilities if specifying shared memory
is supported without hugepages or numa config in order to find
out if domain has suitable setup to make virtiofs work.
The solution is to report source types of memory backing to
determine if memfd is a valid option.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agowhitespace clean-ups
Martin Kletzander [Wed, 14 Jul 2021 13:56:26 +0000 (15:56 +0200)] 
whitespace clean-ups

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
4 years agoutil: Make one debug message nicer
Martin Kletzander [Thu, 15 Jul 2021 10:06:55 +0000 (12:06 +0200)] 
util: Make one debug message nicer

This was bothering someone as the debug message looked like there was an issue
despite it being just a debug message.  Change it to what is actually happening
and why the name is being skipped.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
4 years agoci: refresh cirrus variables for FreeBSD python rename
Daniel P. Berrangé [Wed, 14 Jul 2021 12:34:29 +0000 (13:34 +0100)] 
ci: refresh cirrus variables for FreeBSD python rename

All the python packages got renamed from py37- to py38-

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoqemu: Do not erase duplicate devices from namespace if error occurs
Kristina Hanicova [Wed, 14 Jul 2021 14:46:54 +0000 (16:46 +0200)] 
qemu: Do not erase duplicate devices from namespace if error occurs

If the attempt to attach a device failed, we erased the
unattached device from the namespace. This resulted in erasing an
already attached device in case of a duplicate. We need to check
for existing file in the namespace in order to determine erasing
it in case of a failure.

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

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirprocess: Return retval of the child on success, not 0
Kristina Hanicova [Wed, 14 Jul 2021 14:46:53 +0000 (16:46 +0200)] 
virprocess: Return retval of the child on success, not 0

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: Check for existing file in namespace
Kristina Hanicova [Wed, 14 Jul 2021 14:46:52 +0000 (16:46 +0200)] 
qemu: Check for existing file in namespace

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoApparmor: Add profile for virtxend
Jim Fehlig [Tue, 15 Jun 2021 17:24:14 +0000 (11:24 -0600)] 
Apparmor: Add profile for virtxend

A new apparmor profile initially derived from the libvirtd profile.
All rules were prefixed with the 'audit' qualifier to verify they
are actually used by virtxend. It turns out that several, beyond
the obvious ones, can be dropped in the resulting virtxend profile.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agoApparmor: Add profile for virtqemud
Jim Fehlig [Tue, 15 Jun 2021 17:13:33 +0000 (11:13 -0600)] 
Apparmor: Add profile for virtqemud

A new apparmor profile derived from the libvirtd profile, with non-QEMU
related rules removed. Adopt the libvirt-qemu abstraction to work with
the new profile.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agoapparmor: Allow /usr/libexec for private xen-tools binaries
Olaf Hering [Tue, 13 Jul 2021 13:43:58 +0000 (15:43 +0200)] 
apparmor: Allow /usr/libexec for private xen-tools binaries

This is a followup for commit e906c4d02bdcddf141b4d124afd68c8ee10134fe
("apparmor: Allow /usr/libexec for libxl-save-helper and pygrub"):

In recent rpm versions --libexecdir changed from /usr/lib64 to
/usr/libexec. A plain rpmbuild %configure in xen.git will install all
files, including the private copies of qemu, into /usr/libexec/xen/bin.
Expand the existing pattern to cover also this libexecdir variant.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirfile: Update example use of virDirRead()
Michal Privoznik [Wed, 14 Jul 2021 14:54:54 +0000 (16:54 +0200)] 
virfile: Update example use of virDirRead()

We have an example in virDirRead() documentation on how to use
the function. In there, the directory structure is plain DIR, but
that won't work anymore. Switch over to g_autoptr(DIR) which is
what we use now.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agosyntax-check: s/VIR_DIR_CLOSE/g_autoptr(DIR)/
Michal Privoznik [Wed, 14 Jul 2021 14:53:04 +0000 (16:53 +0200)] 
syntax-check: s/VIR_DIR_CLOSE/g_autoptr(DIR)/

We have a syntax-check rule that forbids explicit closedir().
However, the error message suggest using VIR_DIR_CLOSE() which
was removed a few releases ago (v6.10.0-rc1~389).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agotestQemuMonitorJSONqemuMonitorJSONGetChardevInfo: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 14:49:52 +0000 (16:49 +0200)] 
testQemuMonitorJSONqemuMonitorJSONGetChardevInfo: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agotestQemuMonitorJSONqemuMonitorJSONGetChardevInfo: Remove superfluous `goto`s
Tim Wiederhake [Mon, 5 Jul 2021 14:49:05 +0000 (16:49 +0200)] 
testQemuMonitorJSONqemuMonitorJSONGetChardevInfo: Remove superfluous `goto`s

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agotestQemuMonitorJSONqemuMonitorJSONGetChardevInfo: Use automatic memory management
Tim Wiederhake [Mon, 5 Jul 2021 14:48:02 +0000 (16:48 +0200)] 
testQemuMonitorJSONqemuMonitorJSONGetChardevInfo: Use automatic memory management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agotestQemuMonitorJSONqemuMonitorJSONGetBlockInfo: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 14:36:01 +0000 (16:36 +0200)] 
testQemuMonitorJSONqemuMonitorJSONGetBlockInfo: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agotestQemuMonitorJSONqemuMonitorJSONGetBlockInfo: Remove superfluous `goto`s
Tim Wiederhake [Mon, 5 Jul 2021 14:35:09 +0000 (16:35 +0200)] 
testQemuMonitorJSONqemuMonitorJSONGetBlockInfo: Remove superfluous `goto`s

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agotestQemuMonitorJSONqemuMonitorJSONGetBlockInfo: Use automatic memory management
Tim Wiederhake [Mon, 5 Jul 2021 14:33:56 +0000 (16:33 +0200)] 
testQemuMonitorJSONqemuMonitorJSONGetBlockInfo: Use automatic memory management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agotestQemuMonitorJSONqemuMonitorJSONGetAllBlockStatsInfo: `virHashNew` cannot return...
Tim Wiederhake [Mon, 5 Jul 2021 14:32:07 +0000 (16:32 +0200)] 
testQemuMonitorJSONqemuMonitorJSONGetAllBlockStatsInfo: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agotestQemuMonitorJSONqemuMonitorJSONGetAllBlockStatsInfo: Remove superfluous `goto`s
Tim Wiederhake [Mon, 5 Jul 2021 14:31:31 +0000 (16:31 +0200)] 
testQemuMonitorJSONqemuMonitorJSONGetAllBlockStatsInfo: Remove superfluous `goto`s

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agotestQemuMonitorJSONqemuMonitorJSONGetAllBlockStatsInfo: Use automatic memory management
Tim Wiederhake [Mon, 5 Jul 2021 14:29:49 +0000 (16:29 +0200)] 
testQemuMonitorJSONqemuMonitorJSONGetAllBlockStatsInfo: Use automatic memory management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agonwfilterxml2firewalltest.c: testCompareXMLToArgvFiles: `virHashNew` cannot return...
Tim Wiederhake [Mon, 5 Jul 2021 14:20:04 +0000 (16:20 +0200)] 
nwfilterxml2firewalltest.c: testCompareXMLToArgvFiles: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoqemuMonitorGetMemoryDeviceInfo: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 14:03:19 +0000 (16:03 +0200)] 
qemuMonitorGetMemoryDeviceInfo: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoqemuMonitorGetMemoryDeviceInfo: Use automatic memory management
Tim Wiederhake [Mon, 5 Jul 2021 14:02:40 +0000 (16:02 +0200)] 
qemuMonitorGetMemoryDeviceInfo: Use automatic memory management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoqemuMonitorGetMemoryDeviceInfo: Assign hash table only on success
Tim Wiederhake [Mon, 5 Jul 2021 14:01:00 +0000 (16:01 +0200)] 
qemuMonitorGetMemoryDeviceInfo: Assign hash table only on success

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoiptablesPrivateChainCreate: Remove superfluous `goto`s
Tim Wiederhake [Mon, 5 Jul 2021 13:46:54 +0000 (15:46 +0200)] 
iptablesPrivateChainCreate: Remove superfluous `goto`s

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoiptablesPrivateChainCreate: Use automatic memory management
Tim Wiederhake [Mon, 5 Jul 2021 13:45:17 +0000 (15:45 +0200)] 
iptablesPrivateChainCreate: Use automatic memory management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoiptablesPrivateChainCreate: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 13:44:20 +0000 (15:44 +0200)] 
iptablesPrivateChainCreate: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNWFilterRuleDefToRuleInst: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 11:26:10 +0000 (13:26 +0200)] 
virNWFilterRuleDefToRuleInst: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNWFilterCreateVarsFrom: Remove superfluous `goto`s
Tim Wiederhake [Tue, 6 Jul 2021 08:18:57 +0000 (10:18 +0200)] 
virNWFilterCreateVarsFrom: Remove superfluous `goto`s

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNWFilterCreateVarsFrom: Use automatic memory management
Tim Wiederhake [Tue, 6 Jul 2021 08:18:24 +0000 (10:18 +0200)] 
virNWFilterCreateVarsFrom: Use automatic memory management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNWFilterCreateVarsFrom: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 08:17:22 +0000 (10:17 +0200)] 
virNWFilterCreateVarsFrom: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoAUTHORS: Add myself to the list of commiters
Tim Wiederhake [Wed, 14 Jul 2021 12:37:02 +0000 (14:37 +0200)] 
AUTHORS: Add myself to the list of commiters

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirt-aa-helper: Allow swtpm to fsync on dir
Stefan Berger [Tue, 13 Jul 2021 18:38:32 +0000 (14:38 -0400)] 
virt-aa-helper: Allow swtpm to fsync on dir

Allow swtpm (0.7.0 or later) to fsync on the directory where it writes
its state files into so that "the entry in the directory containing the
file has also reached disk" (fsync(2)).

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemuMonitorGetChardevInfo: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 12:37:59 +0000 (14:37 +0200)] 
qemuMonitorGetChardevInfo: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>