Before commit 24d8968c, virDirClose took a DIR**, and that was never NULL, so its declaration included ATTRIBUTE_NONNULL(1). Since that commit, virDirClose takes a DIR*, and it may be NULL (e.g. if the DIR* is initialized to NULL and was never closed). Even though virDirClose() is currently only called implicitly (as the cleanup for a g_autoptr(DIR)), and (as I've just newly learned) the autocleanup function g_autoptr will only be called if the pointer in question is non-null (see the definition of _GLIB_AUTOPTR_CLEAR_FUNC_NAME in /usr/include/glib-2.0/glib/gmacros.h), it does still cause Coverity to complain that it *could* be called with a NULL, and it's also possible that in the future someone might add code that explicitly calls virDirClose. To eliminate the Coverity complaints, and protect against the hypothetical future where someone both explicitly calls virDirClose() with a potentially NULL value, *and* re-enables the nonnull directive when not building with Coverity (disabled by commit eefb881) this patch removes the ATTRIBUTE_NONNULL(1) from the declaration of virDirClose(). Fixes: 24d8968cd0a718af4badbbc858b1b449fea7205a Reported-by: John Ferlan <jferlan@redhat.com> Details-Research-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Laine Stump <laine@redhat.com>
Libvirt API for virtualization
Libvirt provides a portable, long term stable C API for managing the virtualization technologies provided by many operating systems. It includes support for QEMU, KVM, Xen, LXC, bhyve, Virtuozzo, VMware vCenter and ESX, VMware Desktop, Hyper-V, VirtualBox and the POWER Hypervisor.
For some of these hypervisors, it provides a stateful management daemon which runs on the virtualization host allowing access to the API both by non-privileged local users and remote users.
Layered packages provide bindings of the libvirt C API into other languages including Python, Perl, PHP, Go, Java, OCaml, as well as mappings into object systems such as GObject, CIM and SNMP.
Further information about the libvirt project can be found on the website:
License
The libvirt C API is distributed under the terms of GNU Lesser General Public License, version 2.1 (or later). Some parts of the code that are not part of the C library may have the more restrictive GNU General Public License, version 2.0 (or later). See the files COPYING.LESSER
and COPYING
for full license terms & conditions.
Installation
Instructions on building and installing libvirt can be found on the website:
https://libvirt.org/compiling.html
Contributing
The libvirt project welcomes contributions in many ways. For most components the best way to contribute is to send patches to the primary development mailing list. Further guidance on this can be found on the website:
https://libvirt.org/contribute.html
Contact
The libvirt project has two primary mailing lists:
- libvirt-users@redhat.com (for user discussions)
- libvir-list@redhat.com (for development only)
Further details on contacting the project are available on the website: