[libvirt PATCH] Remove unused variables
by Ján Tomko
These variables are only used for assignment and have
no other effect.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
Found by clang-analyzer. Just install the package with scan-build and
run:
ninja -C build scan-build
(or some meson --reconfigure might be necessary.
OTOH, I did not get ninja coverage to work so far.)
src/conf/domain_conf.c | 4 +---
src/util/virdevmapper.c | 3 +--
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index fd8cdb7695..69e0439e7e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8857,8 +8857,6 @@ virDomainHostdevDefParseXMLCaps(xmlNodePtr node G_GNUC_UNUSED,
const char *type,
virDomainHostdevDefPtr def)
{
- xmlNodePtr sourcenode;
-
/* @type is passed in from the caller rather than read from the
* xml document, because it is specified in different places for
* different kinds of defs - it is an attribute of
@@ -8881,7 +8879,7 @@ virDomainHostdevDefParseXMLCaps(xmlNodePtr node G_GNUC_UNUSED,
return -1;
}
- if (!(sourcenode = virXPathNode("./source", ctxt))) {
+ if (!virXPathNode("./source", ctxt)) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("Missing <source> element in hostdev device"));
return -1;
diff --git a/src/util/virdevmapper.c b/src/util/virdevmapper.c
index a471504176..fe7f611496 100644
--- a/src/util/virdevmapper.c
+++ b/src/util/virdevmapper.c
@@ -162,7 +162,6 @@ virDMSanitizepath(const char *path)
DIR *dh = NULL;
const char *p;
char *ret = NULL;
- int rc;
/* If a path is NOT provided then assume it's DM name */
p = strrchr(path, '/');
@@ -192,7 +191,7 @@ virDMSanitizepath(const char *path)
if (virDirOpen(&dh, DEV_DM_DIR) < 0)
return NULL;
- while ((rc = virDirRead(dh, &ent, DEV_DM_DIR)) > 0) {
+ while (virDirRead(dh, &ent, DEV_DM_DIR) > 0) {
g_autofree char *tmp = g_strdup_printf(DEV_DM_DIR "/%s", ent->d_name);
if (stat(tmp, &sb[1]) == 0 &&
--
2.26.2
4 years, 4 months
[libvirt PATCH 0/3] Run more syntax checks
by Ján Tomko
Some were left out during the meson conversion.
Ján Tomko (3):
config.h: add a copyright blurb
build-aux: set the PYTHON variable in the Makefile
build-aux: add sc_ prefix to more syntax checks
build-aux/Makefile.in | 1 +
build-aux/meson.build | 1 +
build-aux/syntax-check.mk | 18 +++++++++---------
config.h | 18 ++++++++++++++++++
4 files changed, 29 insertions(+), 9 deletions(-)
--
2.26.2
4 years, 4 months
[libvirt PATCH 0/6] Use more of GLib's g_str functions
by Ján Tomko
Ján Tomko (6):
virt-login-shell: correctly calculate string length
conf: use g_strdupv instead of virStringListCopy
util: remove virStringListCopy
Use g_strfeev instead of virStringFreeList
util: recommend g_strfreev instead of virStringListFree
util: delete virStringListFree
src/bhyve/bhyve_command.c | 2 +-
src/bhyve/bhyve_parse_command.c | 10 ++--
src/conf/domain_capabilities.c | 8 +--
src/conf/node_device_conf.c | 2 +-
src/cpu/cpu_arm.c | 2 +-
src/cpu/cpu_ppc64.c | 2 +-
src/libvirt_private.syms | 1 -
src/libxl/libxl_conf.c | 6 +--
src/libxl/xen_common.c | 12 ++---
src/libxl/xen_xl.c | 12 ++---
src/libxl/xen_xm.c | 2 +-
src/lxc/lxc_container.c | 2 +-
src/lxc/lxc_native.c | 20 ++++----
src/qemu/qemu_agent.c | 4 +-
src/qemu/qemu_capabilities.c | 8 +--
src/qemu/qemu_conf.c | 6 +--
src/qemu/qemu_domain.c | 8 +--
src/qemu/qemu_driver.c | 4 +-
src/qemu/qemu_migration_params.c | 2 +-
src/qemu/qemu_monitor_json.c | 14 +++---
src/qemu/qemu_process.c | 2 +-
src/remote/remote_daemon_dispatch.c | 2 +-
src/remote/remote_driver.c | 2 +-
src/storage/storage_backend_rbd.c | 2 +-
src/storage/storage_backend_sheepdog.c | 2 +-
src/storage/storage_backend_zfs.c | 2 +-
src/util/vircgroup.c | 4 +-
src/util/vircgroupv2.c | 2 +-
src/util/virconf.c | 2 +-
src/util/virfile.c | 6 +--
src/util/virfirmware.c | 4 +-
src/util/virlog.c | 8 +--
src/util/virmacmap.c | 2 +-
src/util/virresctrl.c | 14 +++---
src/util/virstring.c | 67 +++-----------------------
src/util/virstring.h | 4 --
src/util/viruri.c | 2 +-
src/vbox/vbox_common.c | 10 ++--
src/vbox/vbox_snapshot_conf.c | 18 +++----
src/vbox/vbox_tmpl.c | 2 +-
src/vz/vz_sdk.c | 2 +-
tests/qemumonitorjsontest.c | 12 ++---
tests/qemuxml2argvtest.c | 2 +-
tests/vboxsnapshotxmltest.c | 2 +-
tests/virconftest.c | 2 +-
tests/virfiletest.c | 2 +-
tests/virstringtest.c | 8 +--
tools/virsh-checkpoint.c | 2 +-
tools/virsh-domain.c | 12 ++---
tools/virsh-host.c | 10 ++--
tools/virsh-nodedev.c | 6 +--
tools/virsh-pool.c | 4 +-
tools/virsh-snapshot.c | 4 +-
tools/virt-login-shell-helper.c | 8 +--
tools/vsh.c | 14 +++---
55 files changed, 155 insertions(+), 219 deletions(-)
--
2.26.2
4 years, 4 months
[libvirt PATCH 0/6] Clean up some includes
by Ján Tomko
Ján Tomko (6):
util: virstring.h: remove stdarg.h include
hyperv: include virxml.h
util: viruri: move libxml include
util: log: move virLogMessage
util: virlog: unexport virLogVMessage
tools: remove unnecessary includes
src/hyperv/hyperv_wmi.c | 1 +
src/libvirt_private.syms | 1 -
src/util/virlog.c | 66 +++++++++++++++++----------------
src/util/virlog.h | 9 -----
src/util/virstring.h | 2 -
src/util/viruri.c | 2 +
src/util/viruri.h | 2 -
tools/virsh-domain-monitor.c | 2 -
tools/virsh-domain.c | 4 --
tools/virsh-host.c | 5 +--
tools/virsh-host.h | 2 +-
tools/virsh-interface.c | 4 --
tools/virsh-network.c | 2 -
tools/virsh-nodedev.c | 1 -
tools/virsh-nwfilter.c | 1 -
tools/virsh-secret.c | 1 -
tools/virsh-secret.h | 2 +-
tools/virsh-snapshot.c | 2 -
tools/virsh-snapshot.h | 2 +-
tools/virsh-volume.c | 2 -
tools/virsh.h | 2 -
tools/virt-admin-completer.c | 1 -
tools/virt-admin.c | 4 +-
tools/virt-host-validate-qemu.c | 1 -
tools/vsh-table.c | 2 -
tools/vsh.c | 3 --
tools/vsh.h | 2 -
27 files changed, 44 insertions(+), 84 deletions(-)
--
2.26.2
4 years, 4 months
[libvirt PATCH 0/8] Some cppcheck-inspired fixes
by Ján Tomko
At least I found a memleak.
Ján Tomko (8):
vz: remove redundant NULL pointer check
Remove redundant conditions
util: command: do not return after abort
util: virhostmem: do not use scanf without field limits
util: sync variable names between header and C files
virsh: completer: use signed variable for XPathNodeSet errors
tools: remove unread variables
tools: virt-admin: do not leak daemon-log settings
src/hypervisor/virhostdev.c | 2 +-
src/libxl/xen_xl.c | 2 +-
src/qemu/qemu_hotplug.c | 3 +--
src/qemu/qemu_process.c | 6 +++---
src/rpc/virnetsocket.c | 2 +-
src/util/vircommand.c | 1 -
src/util/virhostmem.c | 6 ++++--
src/util/virlease.c | 2 +-
src/util/virresctrl.h | 2 +-
src/util/virsocketaddr.h | 8 ++++----
src/vbox/vbox_common.c | 2 +-
src/vz/vz_sdk.c | 8 ++++----
tools/virsh-completer-host.c | 4 ++--
tools/virsh-domain.c | 7 +++----
tools/virt-admin.c | 21 +++++++++------------
15 files changed, 36 insertions(+), 40 deletions(-)
--
2.26.2
4 years, 4 months
Release of libvirt-6.6.0
by Jiri Denemark
The 6.6.0 release of both libvirt and libvirt-python is tagged and
signed tarballs and source RPMs are available at
https://libvirt.org/sources/
https://libvirt.org/sources/python/
Thanks everybody who helped with this release by sending patches,
reviewing, testing, or providing any other feedback. Your work is
greatly appreciated.
* New features
* Allow configuring of ACPI NUMA HMAT
Libvirt allows configuring ACPI Heterogeneous Memory Attribute Table to
hint software running inside the guest on optimization.
* esx: Add a ``type`` attribute for mac addresses.
This attribute allows (when set to ``static``) ignoring VMWare checks of the
MAC addresses that would generate a new one if they were in its OUI
(00:0c:29).
* conf: add control over COW for storage pool directories
The storage pool code now attempts to disable COW by default on btrfs, but
management applications may wish to override this behaviour. This is now
possible via new ``cow`` element.
* Improvements
* esx: Change the NIC limit for recent virtualHW versions
Specifying a virtualHW version greater or equal to 7 (ESXi 4.0) will allow
you to use up to 10 NICs instead of 4 as it was previously.
* qemu: Support encrypted TLS keys for NBD disks
The secret key used for disks can now be encrypted similarly to TLS keys
used for migration, chardev and others.
* qemu: ``VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD`` can now be registered for ``<mirror>``
The event can now be used also for block copy destinations by using the
index of the ``<mirror>`` image.
* qemu: consider available CPUs in ``vcpupin/emulatorpin`` output
This patch changes the default bitmap of ``vcpupin`` and ``emulatorpin``,
in the case of domains with static vcpu placement, all available CPUs
instead of all possible CPUs are returned making these APIs consistent with
the behavior of ``vcpuinfo``.
* Bug fixes
* virdevmapper: Don't use libdevmapper to obtain dependencies
When building domain's private ``/dev`` in a namespace, libdevmapper was
consulted for getting full dependency tree of domain's disks. However, this
meant that libdevmapper opened ``/dev/mapper/control`` which wasn't closed
and was leaked to QEMU. CVE-2020-14339
* qemu: Report correct ``index`` in ``VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD``
Starting from libvirt 5.10 with QEMU 4.2 the
``VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD`` event would report incorrect device
``index`` when reported for an image from the backing chain of a disk.
* qemu: Don't fail active layer block commit or block copy in certain cases
Starting from libvirt-6.5 an active layer block commit or a block copy could
fail if the same destination was used more than once.
* qemu: Don't change ownership of restore file
When restoring a domain from a file, Libvirt no longer changes its ownership.
* qemu: Set SPAPR TPM default to 2.0 and prevent 1.2 choice
The firmware (SLOF) on QEMU for ppc64 does not support TPM 1.2, so prevent
the choice of TPM 1.2 when the SPAPR device model is chosen and use a
default of '2.0' (TPM 2) for the backend.
* qemu: Do not set ``//cpu/@migratable`` for running domains
Libvirt release of 6.4.0 started to fill the default value for
``//cpu/@migratable`` attribute according to QEMU support. However, active
domains either have the migratable attribute already set or they were
started with older Libvirt which doesn't support the attribute.
Enjoy.
Jirka
4 years, 4 months
[libvirt PATCH 0/6] ci: clang on linux and more parallelism
by Ján Tomko
Run clang tests on Fedora Rawhide, Centos 8 and Debian 10.
Specify needs: for everything to prevent pointless waiting.
https://gitlab.com/jano.tomko/libvirt/-/pipelines/173023075
Ján Tomko (6):
ci: refresh Dockerfiles
ci: refresh Dockerfiles
ci: add clang jobs
ci: run Cirrus-based builds sooner
ci: specify containter dependencies for all the jobs
ci: run container jobs right away
.gitlab-ci.yml | 76 +++++++++++++++++++
ci/containers/libvirt-centos-7.Dockerfile | 2 +-
ci/containers/libvirt-centos-8.Dockerfile | 2 +-
.../libvirt-centos-stream.Dockerfile | 2 +-
...libvirt-debian-10-cross-aarch64.Dockerfile | 2 +-
.../libvirt-debian-10-cross-armv6l.Dockerfile | 3 +-
.../libvirt-debian-10-cross-armv7l.Dockerfile | 3 +-
.../libvirt-debian-10-cross-i686.Dockerfile | 2 +-
.../libvirt-debian-10-cross-mips.Dockerfile | 2 +-
...ibvirt-debian-10-cross-mips64el.Dockerfile | 2 +-
.../libvirt-debian-10-cross-mipsel.Dockerfile | 2 +-
...libvirt-debian-10-cross-ppc64le.Dockerfile | 2 +-
.../libvirt-debian-10-cross-s390x.Dockerfile | 2 +-
ci/containers/libvirt-debian-10.Dockerfile | 2 +-
...ibvirt-debian-sid-cross-aarch64.Dockerfile | 2 +-
...libvirt-debian-sid-cross-armv6l.Dockerfile | 3 +-
...libvirt-debian-sid-cross-armv7l.Dockerfile | 3 +-
.../libvirt-debian-sid-cross-i686.Dockerfile | 2 +-
...bvirt-debian-sid-cross-mips64el.Dockerfile | 2 +-
...libvirt-debian-sid-cross-mipsel.Dockerfile | 3 +-
...ibvirt-debian-sid-cross-ppc64le.Dockerfile | 2 +-
.../libvirt-debian-sid-cross-s390x.Dockerfile | 2 +-
ci/containers/libvirt-debian-sid.Dockerfile | 2 +-
ci/containers/libvirt-fedora-31.Dockerfile | 2 +-
ci/containers/libvirt-fedora-32.Dockerfile | 2 +-
...rt-fedora-rawhide-cross-mingw32.Dockerfile | 1 +
...rt-fedora-rawhide-cross-mingw64.Dockerfile | 1 +
.../libvirt-fedora-rawhide.Dockerfile | 2 +-
ci/containers/libvirt-opensuse-151.Dockerfile | 2 +-
ci/containers/libvirt-ubuntu-1804.Dockerfile | 2 +-
ci/containers/libvirt-ubuntu-2004.Dockerfile | 2 +-
31 files changed, 111 insertions(+), 28 deletions(-)
--
2.26.2
4 years, 4 months
[PATCH for 6.6.0] NEWS: Document changes for upcoming release
by Michal Privoznik
In contrast with other releases, this time NEWS is pretty much
updated. I've identified only a couple of features/bug fixes
worth mentioning that were not mentioned yet.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
NEWS.rst | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index 1314f3e698..d97ca501dc 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -24,6 +24,12 @@ v6.6.0 (unreleased)
MAC addresses that would generate a new one if they were in its OUI
(00:0c:29).
+ * conf: add control over COW for storage pool directories
+
+ The storage pool code now attempts to disable COW by default on btrfs, but
+ management applications may wish to override this behaviour. This is now
+ possible via new ``cow`` element.
+
* **Improvements**
* esx: Change the NIC limit for recent virtualHW versions
@@ -41,6 +47,14 @@ v6.6.0 (unreleased)
The event can now be used also for block copy destinations by using the
index of the ``<mirror>`` image.
+ * qemu: consider available CPUs in ``vcpupin/emulatorpin`` output
+
+ This patch changes the default bitmap of ``vcpupin`` and ``emulatorpin``,
+ in the case of domains with static vcpu placement, all available CPUs
+ instead of all possible CPUs are returned making these APIs consistent with
+ the behavior of ``vcpuinfo``.
+
+
* **Bug fixes**
* virdevmapper: Don't use libdevmapper to obtain dependencies
@@ -61,6 +75,24 @@ v6.6.0 (unreleased)
Starting from libvirt-6.5 an active layer block commit or a block copy could
fail if the same destination was used more than once.
+ * qemu: Don't change ownership of restore file
+
+ When restoring a domain from a file, Libvirt no longer changes its ownership.
+
+ * qemu: Set SPAPR TPM default to 2.0 and prevent 1.2 choice
+
+ The firmware (SLOF) on QEMU for ppc64 does not support TPM 1.2, so prevent
+ the choice of TPM 1.2 when the SPAPR device model is chosen and use a
+ default of '2.0' (TPM 2) for the backend.
+
+ * qemu: Do not set ``//cpu/@migratable`` for running domains
+
+ Libvirt release of 6.4.0 started to fill the default value for
+ ``//cpu/@migratable`` attribute according to QEMU support. However, active
+ domains either have the migratable attribute already set or they were
+ started with older Libvirt which doesn't support the attribute.
+
+
v6.5.0 (2020-07-03)
===================
--
2.26.2
4 years, 4 months