[libvirt] [PATCH] virresctrl: fix MBA memory leak
by Pavel Hrdina
The 'bandwidths' variable is allocated using VIR_RESIZE_N so it has to
be freed as well.
==118315== 8 bytes in 1 blocks are definitely lost in loss record 299 of 2,401
==118315== at 0x4C29DAD: malloc (vg_replace_malloc.c:308)
==118315== by 0x4C2C100: realloc (vg_replace_malloc.c:836)
==118315== by 0x52C3FAF: virReallocN (viralloc.c:245)
==118315== by 0x52C4079: virExpandN (viralloc.c:294)
==118315== by 0x532BBA8: virResctrlAllocParseProcessMemoryBandwidth (virresctrl.c:1156)
==118315== by 0x532BBA8: virResctrlAllocParseMemoryBandwidthLine (virresctrl.c:1211)
==118315== by 0x532BBA8: virResctrlAllocParse (virresctrl.c:1414)
==118315== by 0x532BBA8: virResctrlAllocGetGroup (virresctrl.c:1446)
==118315== by 0x532C11D: virResctrlAllocGetDefault (virresctrl.c:1464)
==118315== by 0x532D15E: virResctrlAllocAssign (virresctrl.c:1923)
==118315== by 0x532D15E: virResctrlAllocCreate (virresctrl.c:2042)
==118315== by 0x31E1ABEE: qemuProcessResctrlCreate (qemu_process.c:2596)
==118315== by 0x31E1ABEE: qemuProcessLaunch (qemu_process.c:6444)
==118315== by 0x31E1E341: qemuProcessStart (qemu_process.c:6721)
==118315== by 0x31E81315: qemuDomainObjStart.constprop.50 (qemu_driver.c:7288)
==118315== by 0x31E81A65: qemuDomainCreateWithFlags (qemu_driver.c:7341)
==118315== by 0x54DDB4B: virDomainCreate (libvirt-domain.c:6534)
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/util/virresctrl.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
index 9e477fc064..87feb4bdcf 100644
--- a/src/util/virresctrl.c
+++ b/src/util/virresctrl.c
@@ -407,6 +407,7 @@ virResctrlAllocDispose(void *obj)
virResctrlAllocMemBWPtr mem_bw = alloc->mem_bw;
for (i = 0; i < mem_bw->nbandwidths; i++)
VIR_FREE(mem_bw->bandwidths[i]);
+ VIR_FREE(alloc->mem_bw->bandwidths);
VIR_FREE(alloc->mem_bw);
}
--
2.20.1
5 years, 8 months
[libvirt] [PATCH v3 0/7] extend virsh domstate to show additional information
by Bjoern Walk
This patch series introduces the ability to save additional information
for the domain state and exposes this information in virsh domstate.
For example in the case of QEMU guest panic events, we can provide additional
information like the crash reason or register state of the domain. This
information usually gets logged in the domain log but for debugging it is
useful to have it accessible from the client. Therefore, let's introduce a new
public API function, virDomainGetStateParams, an extensible version of
virDomainGetState, which returns the complete state of the domain, including
newly introduced additional information.
Let's also extend virsh domstate and introduce a new parameter --info to show
the domain state, reason and additional information when available.
virsh # domstate --info guest-1
crashed (panicked)
s390.core = 0
s390.psw-mask = 0x0002000180000000
s390.psw-addr = 0x000000000010f146
s390.reason = disabled-wait
v2 -> v3:
* try to find a reasonable naming-scheme for parameters
* make state/reason in virDomainGetStateParams optional
* use new API only when requested
* print additional information per line for easier consumption
v1 -> v2:
* refactored the public API according to discussions to provide a
more machine-parsable interface
Bjoern Walk (7):
qemu: monitor: move event data structure to domain
qemu: domain: store and update panic info
lib: introduce virDomainGetStateParams function
remote: implement remoteDomainGetStateParams
qemu: implement qemuDomainGetStateParams
virsh: domstate: report detailed state if available
news: add entry for virDomainGetStateParams
docs/news.xml | 11 +++
include/libvirt/libvirt-domain.h | 76 +++++++++++++++++
src/driver-hypervisor.h | 9 ++
src/libvirt-domain.c | 62 ++++++++++++++
src/libvirt_public.syms | 5 ++
src/qemu/qemu_domain.c | 80 +++++++++++++++++-
src/qemu/qemu_domain.h | 47 +++++++++++
src/qemu/qemu_driver.c | 126 +++++++++++++++++++++++++++-
src/qemu/qemu_monitor.c | 53 +-----------
src/qemu/qemu_monitor.h | 48 ++---------
src/qemu/qemu_monitor_json.c | 20 ++---
src/qemu/qemu_process.c | 2 +-
src/remote/remote_daemon_dispatch.c | 50 +++++++++++
src/remote/remote_driver.c | 48 +++++++++++
src/remote/remote_protocol.x | 22 ++++-
src/remote_protocol-structs | 13 +++
tools/virsh-domain-monitor.c | 94 +++++++++++++++++++--
tools/virsh.pod | 5 +-
18 files changed, 651 insertions(+), 120 deletions(-)
--
2.19.1
5 years, 8 months
[libvirt] [PATCH v5] tests: perform cross compiler builds on GitLab CI
by Daniel P. Berrangé
GitLab CI provides some shared build runners that use Docker containers.
This resource can usefully run cross-compiled builds since all other CI
build testing is currently x86 only, and Travis CI is already very busy
testing native builds.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Changed in v4:
- Fix env name
- Rename jobs to match image name
.gitlab-ci.yml | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 74 insertions(+)
create mode 100644 .gitlab-ci.yml
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000000..f576757c88
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,74 @@
+.job_template: &job_definition
+ script:
+ - mkdir vpath
+ - cd vpath
+ - ../autogen.sh $CONFIGURE_OPTS
+ - make -j $(getconf _NPROCESSORS_ONLN)
+
+debian-9-cross-aarch64:
+ <<: *job_definition
+ image: quay.io/libvirt/buildenv-debian-9-cross-aarch64:master
+
+debian-9-cross-armv6l:
+ <<: *job_definition
+ image: quay.io/libvirt/buildenv-debian-9-cross-armv6l:master
+
+debian-9-cross-armv7l:
+ <<: *job_definition
+ image: quay.io/libvirt/buildenv-debian-9-cross-armv7l:master
+
+debian-9-cross-mips64el:
+ <<: *job_definition
+ image: quay.io/libvirt/buildenv-debian-9-cross-mips64el:master
+
+debian-9-cross-mips:
+ <<: *job_definition
+ image: quay.io/libvirt/buildenv-debian-9-cross-mips:master
+
+debian-9-cross-mipsel:
+ <<: *job_definition
+ image: quay.io/libvirt/buildenv-debian-9-cross-mipsel:master
+
+debian-9-cross-ppc64le:
+ <<: *job_definition
+ image: quay.io/libvirt/buildenv-debian-9-cross-ppc64le:master
+
+debian-9-cross-s390x:
+ <<: *job_definition
+ image: quay.io/libvirt/buildenv-debian-9-cross-s390x:master
+
+debian-sid-cross-aarch64:
+ <<: *job_definition
+ image: quay.io/libvirt/buildenv-debian-sid-cross-aarch64:master
+
+debian-sid-cross-armv6l:
+ <<: *job_definition
+ image: quay.io/libvirt/buildenv-debian-sid-cross-armv6l:master
+
+debian-sid-cross-armv7l:
+ <<: *job_definition
+ image: quay.io/libvirt/buildenv-debian-sid-cross-armv7l:master
+
+debian-sid-cross-i686:
+ <<: *job_definition
+ image: quay.io/libvirt/buildenv-debian-sid-cross-i686:master
+
+debian-sid-cross-mips64el:
+ <<: *job_definition
+ image: quay.io/libvirt/buildenv-debian-sid-cross-mips64el:master
+
+debian-sid-cross-mips:
+ <<: *job_definition
+ image: quay.io/libvirt/buildenv-debian-sid-cross-mips:master
+
+debian-sid-cross-mipsel:
+ <<: *job_definition
+ image: quay.io/libvirt/buildenv-debian-sid-cross-mipsel:master
+
+debian-sid-cross-ppc64le:
+ <<: *job_definition
+ image: quay.io/libvirt/buildenv-debian-sid-cross-ppc64le:master
+
+debian-sid-cross-s390x:
+ <<: *job_definition
+ image: quay.io/libvirt/buildenv-debian-sid-cross-s390x:master
--
2.20.1
5 years, 8 months
[libvirt] [PATCH 0/4] Add 'label' arg to VIR_ENUM_IMPL
by Cole Robinson
This is a different take on an RFE I posted in July:
https://www.redhat.com/archives/libvir-list/2018-July/msg01815.html
The goal of this series is to get us close to being able to
raise errors from ToString and FromString functions directly. This
will allow us to drop many hundreds of lines of error reporting
and accompanying translator load.
The first attempt above added a new macro, VIR_ENUM_IMPL_LABEL,
which would take a string label, like 'domain type' for virDomainType
enum. The generated ToString and FromString functions for that
enum would now raise errors containing the label. Redundant error
reporting could now be stripped out piece by piece as individual
enums are converted.
Thinking some more though I don't really like this strategy. Calling
code won't have an easy way to know whether ToString/FromString
functions are the type that raise errors or not, which could lead
to new code accidentally omitting them and failing to raise an error.
It could also stretch out the time that the code base is in a half
transitioned state.
This series is a slightly different direction. VIR_ENUM_IMPL
now always takes a label, but for now we don't actually raise any
errors. Later at a chosen time we can enable error reporting in the
code and begin removing duplicate error reporting. The only downside
is that until the transition is complete, there may be cases of
double error reporting, but that's the lesser of two evils compared
to the previous approach IMO.
So the feedback I'm looking for:
- Is this worth doing? (danpb+mprivozn said as much for first posting)
- Is this approach acceptable?
- Review of the strings added in the last patch
Notes:
- This is on top of pkrempa's virenum.c patches on list
- The last two patches are separated to make review easier, but they
will be committed together
- When enabled, one notable case this will make error reporting worse
is virTristate usage. But I think if we manually implement
*TOString/FromString wrappers in that case we can require callers
to pass in an identifying string. Something to think about for later
Cole Robinson (4):
Always put _LAST enums on second line of VIR_ENUM_IMPL
cfg.mk: Only force _LAST enum on VIR_ENUM_IMPL second line
util: Add 'label' field to VIR_ENUM_IMPL
Add string labels to all VIR_ENUM_IMPL calls
cfg.mk | 6 +-
docs/apibuild.py | 12 ++
src/access/viraccessperm.c | 20 +-
src/conf/capabilities.c | 3 +-
src/conf/cpu_conf.c | 21 +-
src/conf/device_conf.c | 3 +-
src/conf/domain_capabilities.c | 3 +-
src/conf/domain_conf.c | 333 +++++++++++++++++++-----------
src/conf/interface_conf.c | 2 +-
src/conf/netdev_vlan_conf.c | 3 +-
src/conf/network_conf.c | 11 +-
src/conf/node_device_conf.c | 12 +-
src/conf/numa_conf.c | 7 +-
src/conf/nwfilter_conf.c | 21 +-
src/conf/snapshot_conf.c | 6 +-
src/conf/storage_adapter_conf.c | 2 +-
src/conf/storage_conf.c | 18 +-
src/libxl/libxl_domain.c | 3 +-
src/locking/lock_daemon.c | 3 +-
src/logging/log_daemon.c | 3 +-
src/lxc/lxc_domain.c | 7 +-
src/lxc/lxc_native.c | 3 +-
src/network/leaseshelper.c | 3 +-
src/qemu/qemu_agent.c | 4 +-
src/qemu/qemu_capabilities.c | 3 +-
src/qemu/qemu_command.c | 27 ++-
src/qemu/qemu_domain.c | 12 +-
src/qemu/qemu_driver.c | 6 +-
src/qemu/qemu_firmware.c | 6 +-
src/qemu/qemu_migration.c | 3 +-
src/qemu/qemu_migration_cookie.c | 2 +-
src/qemu/qemu_migration_params.c | 9 +-
src/qemu/qemu_monitor.c | 8 +-
src/qemu/qemu_monitor_json.c | 10 +-
src/remote/remote_daemon.c | 3 +-
src/util/vircgroup.c | 3 +-
src/util/vircgroupbackend.c | 3 +-
src/util/vircgroupv1.c | 3 +-
src/util/vircgroupv2.c | 3 +-
src/util/virconf.c | 3 +-
src/util/virenum.c | 28 ++-
src/util/virenum.h | 15 +-
src/util/virerror.c | 3 +-
src/util/virfirewall.c | 3 +-
src/util/virfirewalld.c | 6 +-
src/util/virgic.c | 3 +-
src/util/virhook.c | 20 +-
src/util/virkeycode.c | 3 +-
src/util/virlog.c | 3 +-
src/util/virmdev.c | 3 +-
src/util/virnetdev.c | 6 +-
src/util/virnetdevmacvlan.c | 3 +-
src/util/virnetdevvportprofile.c | 6 +-
src/util/virpci.c | 9 +-
src/util/virperf.c | 3 +-
src/util/virprocess.c | 3 +-
src/util/virresctrl.c | 12 +-
src/util/virsecret.c | 3 +-
src/util/virstorageencryption.c | 4 +-
src/util/virstoragefile.c | 17 +-
src/util/virsysinfo.c | 3 +-
src/util/virtypedparam.c | 3 +-
src/util/virutil.c | 1 -
src/vmware/vmware_conf.c | 3 +-
src/vmx/vmx.c | 3 +-
tests/group-qemu-caps.pl | 2 +-
tests/virkeycodetest.c | 3 +-
tools/virsh-domain-monitor.c | 24 +--
tools/virsh-domain.c | 56 ++---
tools/virsh-host.c | 3 +-
tools/virsh-network.c | 10 +-
tools/virsh-nodedev.c | 2 +-
tools/virsh-pool.c | 4 +-
tools/virsh-secret.c | 2 +-
tools/virsh-volume.c | 5 +-
tools/virt-admin.c | 2 +-
tools/virt-host-validate-common.c | 3 +-
77 files changed, 561 insertions(+), 334 deletions(-)
--
2.21.0
5 years, 8 months
[libvirt] [PATCH 0/3] vz: fixes after commits refactoring common snapshot code
by Nikolay Shirokovskiy
Nikolay Shirokovskiy (3):
vz: fix for tracking current snapshot
vz: fixes: snapshot: Switch type of virDomainSnapshotObj.def
vz: fixes: snapshot: Factor out virDomainMomentDef class
src/vz/vz_driver.c | 36 +++++++-----------------------------
src/vz/vz_sdk.c | 24 +++++++++++-------------
2 files changed, 18 insertions(+), 42 deletions(-)
--
1.8.3.1
5 years, 8 months
[libvirt] [PATCH 0/2] sasl: Fix CFLAGS use, switch to pkg-config
by Andrea Bolognani
Andrea Bolognani (2):
src: Include SASL_CFLAGS where appropriate
m4: sasl: Use pkg-config
m4/virt-sasl.m4 | 2 +-
src/admin/Makefile.inc.am | 6 ++++++
src/locking/Makefile.inc.am | 12 ++++++++++++
src/logging/Makefile.inc.am | 6 ++++++
src/remote/Makefile.inc.am | 6 ++++++
src/rpc/Makefile.inc.am | 6 ++++++
6 files changed, 37 insertions(+), 1 deletion(-)
--
2.20.1
5 years, 8 months
[libvirt] [PATCH] build: set --without-firewalld-zone in configure commandline for Fedora 30
by Laine Stump
The firewalld package in Fedora 30 didn't get support for rich rule
priorities, which is required by the libvirt zonefile that's installed
when the build is configured with --with-firewalld-zone, so we need to
set --without-firewalld-zone for that version of Fedora. The needed
feature is already upstream in firewalld, so it just needs another
upstream release to be there. Let's be optimistic and assume that will
happen prior to F31.
Signed-off-by: Laine Stump <laine(a)laine.org>
---
libvirt.spec.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 8ea27c91a3..18f0a0e217 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -137,7 +137,7 @@
%define with_firewalld 1
-%if 0%{?fedora} >= 30 || 0%{?rhel} > 7
+%if 0%{?fedora} >= 31 || 0%{?rhel} > 7
%define with_firewalld_zone 0%{!?_without_firewalld_zone:1}
%endif
--
2.20.1
5 years, 8 months
[libvirt] [PATCH v4 0/7] Facilitate running libvirt builds via docker containers
by Daniel P. Berrangé
For a while QEMU has provided simple make rules for building QEMU inside
standard docker container environments. This provides an equivalent
mechanism for libvirt inspired by QEMU's.
QEMU actually builds the container images on developer's machines
locally. Libvirt already hosts pre-built images on quay.io, so that is
used directly as it is quicker to download them than to build them
locally. This also ensures the container contents match what the live
CI system is using, as opposed to building an image with newer packages.
Changed in v4:
- Re-add cross-compilation patches now that containers exist
- Add CI_ prefix on all variables to avoid clashing with
automake defined variables
- Fix path given to -f arg for ci-check target
- Remove dead code
- Fix check for submodule checkout existing
- Ensure macOS Homebrew is updated
Changed in v3:
- Lots of new variables & variable renames
- Rename to top level Makefile.ci
- Rename make targets to have @ separator for the image
- Refactor macOS travis config
Changed in v2:
- Drop cross-compilation patches temporarily. The cross-compiler
images are not yet built on quay.io and rather than creating and
bulding many more images manually, I'm working on script to
automate setup of quay.io images
- Many changes to the make rules to make it possible to use them
from Travis CI to match its currently testing setup
- Modify Travis CI config to use the new make rules for consistency
Daniel P. Berrangé (7):
tests: add targets for building libvirt inside Docker containers
travis: convert Ubuntu, CentOS & MinGW builds to use new make rules
travis: use declarative syntax for Homebrew packages
travis: remove display of test-suite.log from macOS
travis: put macOS script inline in the macOS matrix entry
tests: add cross compiler images to CI test help output
tests: perform cross compiler builds on GitLab CI
.gitignore | 1 +
.gitlab-ci.yml | 74 +++++++++++++++++
.travis.yml | 78 +++++------------
Makefile.am | 2 +
Makefile.ci | 222 +++++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 321 insertions(+), 56 deletions(-)
create mode 100644 .gitlab-ci.yml
create mode 100644 Makefile.ci
--
2.20.1
5 years, 8 months
[libvirt] [PATCH v2 0/3] docs: add advanced search capability
by Daniel P. Berrangé
Andrea suggested it would be nice to redirect the search box to a local
search page which then let the user submit a site-restricted search to
google for website vs wiki vs mailing lists.
I took a slightly different approach here, and instead simply popup an
extra set of radio buttons below the main search field. This lets the
user select the site to search straightaway without the intermediate
page.
Changed in v2:
- Add missing rules for installing javascript
- Use mediawiki search
- Search dev & users lists separately
- Whitespace fixes
Daniel P. Berrangé (3):
docs: ensure javascript files are included in dist & install rules
docs: move javascript logic into a standalone file
docs: add advanced search capabilities
docs/Makefile.am | 15 +++++++++-
docs/js/main.js | 77 ++++++++++++++++++++++++++++++++++++++++++++++++
docs/libvirt.css | 39 ++++++++++++++++++++++++
docs/mobile.css | 7 +++++
docs/page.xsl | 51 ++++++++++----------------------
5 files changed, 152 insertions(+), 37 deletions(-)
create mode 100644 docs/js/main.js
--
2.20.1
5 years, 8 months
[libvirt] [PATCH] domaincapstest: Call virFileWrapperClearPrefixes only on non-WIN32
by Michal Privoznik
The virFileWrapperClearPrefixes() function is defined only when
building for non-WIN32.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Technically a build breaker fix, but I can't decide if ifdef is better
or removing the call is better.
tests/domaincapstest.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c
index 3ee95a4b58..92676bdd6e 100644
--- a/tests/domaincapstest.c
+++ b/tests/domaincapstest.c
@@ -476,7 +476,9 @@ mymain(void)
DO_TEST_BHYVE("fbuf", "/usr/sbin/bhyve", &bhyve_caps, VIR_DOMAIN_VIRT_BHYVE);
#endif /* WITH_BHYVE */
+#ifndef WIN32
virFileWrapperClearPrefixes();
+#endif /* WIN32 */
return ret;
}
--
2.21.0
5 years, 8 months