[libvirt PATCH] ci: display installed packages at start of build
by Daniel P. Berrangé
When a build fails it is helpful to know what packages were installed,
because by the time we look at the build job output, the original
container image might have changed.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
.gitlab-ci.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d486faca58..6ba11a0431 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -24,6 +24,7 @@ include: '/ci/gitlab.yml'
key: "$CI_JOB_NAME"
before_script:
- *script_variables
+ - cat /packages.txt
script:
- meson setup build --werror $MESON_ARGS || (cat build/meson-logs/meson-log.txt && exit 1)
- meson dist -C build --no-tests
@@ -43,6 +44,7 @@ include: '/ci/gitlab.yml'
key: "$CI_JOB_NAME"
before_script:
- *script_variables
+ - cat /packages.txt
script:
- meson setup build --werror $MESON_OPTS || (cat build/meson-logs/meson-log.txt && exit 1)
- meson compile -C build
--
2.33.1
3 years, 1 month
[libvirt PATCH 0/4] Coverity fixes
by Ján Tomko
Ján Tomko (4):
tools: virt-host-validate: fix memory leak
vbox: fix vboxCapsInit
ch: fix logic in virCHMonitorBuildPtyJson
tests: pcivpdtest: check return value of virCreateAnonymousFile
src/ch/ch_monitor.c | 4 +---
src/vbox/vbox_common.c | 1 -
tests/virpcivpdtest.c | 20 ++++++++++++++++++++
tools/virt-host-validate-ch.c | 2 +-
4 files changed, 22 insertions(+), 5 deletions(-)
--
2.31.1
3 years, 1 month
[libvirt PATCH 0/3] ci: improve mingw coverage
by Daniel P. Berrangé
This ensures at least one mingw job is gating for pipelines
Daniel P. Berrangé (3):
ci: replace Fedora 33 with Fedora 35
ci: refresh variables/dockerfiles with latest content
ci: run a mingw64 job on stable Fedora
ci/cirrus/freebsd-12.vars | 7 +-
ci/cirrus/freebsd-13.vars | 7 +-
ci/cirrus/freebsd-current.vars | 7 +-
ci/cirrus/macos-11.vars | 7 +-
ci/containers/centos-8.Dockerfile | 7 +-
ci/containers/centos-stream-8.Dockerfile | 7 +-
.../fedora-35-cross-mingw32.Dockerfile | 92 +++++++++++++++++++
.../fedora-35-cross-mingw64.Dockerfile | 92 +++++++++++++++++++
...ora-33.Dockerfile => fedora-35.Dockerfile} | 2 +-
.../fedora-rawhide-cross-mingw32.Dockerfile | 2 +-
.../fedora-rawhide-cross-mingw64.Dockerfile | 2 +-
ci/containers/fedora-rawhide.Dockerfile | 2 +-
ci/containers/opensuse-tumbleweed.Dockerfile | 2 +-
ci/gitlab.yml | 50 ++++++----
ci/manifest.yml | 13 ++-
15 files changed, 254 insertions(+), 45 deletions(-)
create mode 100644 ci/containers/fedora-35-cross-mingw32.Dockerfile
create mode 100644 ci/containers/fedora-35-cross-mingw64.Dockerfile
rename ci/containers/{fedora-33.Dockerfile => fedora-35.Dockerfile} (98%)
--
2.33.1
3 years, 1 month
[PATCH v3 0/2] Fix /proc/*/stat parsing
by Martin Kletzander
While working on some polkit stuff I found out that we are inconsistent with the
way we parse /proc/*/stat files, so I added a new helper instead along with some
tests. Unfortunately using it for the thing I wanted is not really viable in
the end, so it "violates" the Rule of three, but at least it does something
correctly.
v3:
- Added an enum with names for the fields of the file
- Made this not limited to linux as that was the way it worked in qemu before
v2:
- https://listman.redhat.com/archives/libvir-list/2021-November/msg00606.html
- Fixed open64 by just using virFileReadAllQuiet instead of g_file_get_contents
- Removed some leftover unused variables
- Still do not know why my cirrus builds fail
v1:
- https://listman.redhat.com/archives/libvir-list/2021-November/msg00580.html
Martin Kletzander (2):
util: Add virProcessGetStat
Use virProcessGetStat
src/libvirt_private.syms | 1 +
src/qemu/qemu_driver.c | 34 ++-----
src/util/virprocess.c | 125 +++++++++++++++++---------
src/util/virprocess.h | 66 ++++++++++++++
tests/meson.build | 1 +
tests/virprocessstatdata/complex/stat | 2 +
tests/virprocessstatdata/simple/stat | 1 +
tests/virprocessstattest.c | 88 ++++++++++++++++++
8 files changed, 249 insertions(+), 69 deletions(-)
create mode 100644 tests/virprocessstatdata/complex/stat
create mode 100644 tests/virprocessstatdata/simple/stat
create mode 100644 tests/virprocessstattest.c
--
2.34.0
3 years, 1 month
[libvirt PATCH 0/2] snapshot revert fix followup
by Pavel Hrdina
Pavel Hrdina (2):
qemu_monitor: remove unused load snapshot code
virsh: man: update snapshot-revert description
docs/manpages/virsh.rst | 4 ++++
src/qemu/qemu_monitor.c | 11 -----------
src/qemu/qemu_monitor.h | 1 -
src/qemu/qemu_monitor_text.c | 36 ------------------------------------
src/qemu/qemu_monitor_text.h | 1 -
5 files changed, 4 insertions(+), 49 deletions(-)
--
2.31.1
3 years, 1 month
[PATCH 00/12] Remove virXMLPropStringLimit and virXPathStringLimit
by Peter Krempa
The functions have API which is impossible to be use correctly by
callers. Refactor callers and remove the functions.
Note that this patchset preserves semantics of the callers (except for
removing duplicate or ignored errors). Some of the callers look fishy,
but that is not addressed here.
Peter Krempa (12):
util: seclabel: Define autoptr cleanup func for virSecurityLabelDef
and virSecurityDeviceLabelDef
virSecurityLabelDef: Declare 'type' as 'virDomainSeclabelType'
virSecurityLabelDefParseXML: Directly assign strings into appropriate
variables
virSecurityLabelDefParseXML: Don't reuse temporary string 'p'
virSecurityLabelDefParseXML: Use automatic freeing for 'seclabel'
virSecurityLabelDefParseXML: Remove pointless 'error' label
virNodeDeviceCapVPDParseCustomFields: Don't use 'virXPathStringLimit'
virSecurityLabelDefParseXML: Don't use 'virXPathStringLimit'
virSecurityDeviceLabelDefParseXML: Use automatic memory clearing for
temp strings
virSecurityDeviceLabelDefParseXML: Don't use 'virXPathStringLimit'
virSecurityLabelDefParseXML: Don't use virXMLPropStringLimit
util: xml: Remove virXMLPropStringLimit and virXPathStringLimit
src/conf/domain_conf.c | 104 +++++++++++++++-----------------
src/conf/node_device_conf.c | 6 +-
src/libvirt_private.syms | 2 -
src/security/security_selinux.c | 3 +-
src/util/virseclabel.h | 6 +-
src/util/virxml.c | 62 -------------------
src/util/virxml.h | 8 ---
7 files changed, 59 insertions(+), 132 deletions(-)
--
2.31.1
3 years, 1 month
[PATCH 0/1] tools/bash-completion: fix variable leaks of "IFS" and "word"
by Koichi Murase
Description:
The bash-completion function for virsh, which is defined in
/usr/share/bash-completion/completions/virsh (generated from libvirt
tools/bash-completion/vsh.in), overwrites the shell variables "IFS"
and "word" on query for completions.
Repeat-By:
I am testing it with Fedora 35 Workstation where the completion
script is provided by the package:
libvirt-client-7.6.0-3.fc35.x86_64
With a Bash session with bash-completion loaded, one can observe the
change of Bash behavior after the attempt of the completion for
"virsh" command as follows:
$ declare -p IFS | cat -A
declare -- IFS=" ^I$
"$
$ virsh a[TAB][TAB]
allocpages attach-device attach-disk attach-interface autostart
$ virsh a[C-c]
$ declare -p IFS | cat -A
declare -- IFS="$
"$
Originally the value of IFS is IFS=$' \t\n', but it becomes
IFS=$'\n' after the attempt of the completion. After that, word
splitting of the shell will not be processed as normal:
$ a='a b c'
$ printf '<%s>\n' $a
<a>
<b>
<c>
$ virsh a[TAB][TAB][C-c]
$ printf '<%s>\n' $a
<a b c>
The shell variable "word" is also affected by the virsh completion.
Fix:
The completion function "_virsh_complete" should declare "IFS" and
"word" as local variables before changing them.
Reference:
I initially received the related issue in my project at
https://github.com/akinomyoga/ble.sh/issues/147
--
Koichi
Koichi Murase (1):
bash-completion: fix variable leaks of "IFS" and "word"
tools/bash-completion/vsh.in | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--
2.21.3
3 years, 1 month
[PATCH] meson: fix cpuset_getaffinity() detection
by Roman Bogorodskiy
The cpuset_getaffinity() function is checked in sys/cpuset.h to see if
BSD CPU affinity APIs are available. This check requires including
sys/param.h to work properly, otherwise the test program fails with
unrelated errors like:
/usr/include/sys/cpuset.h:155:1: error: unknown type name
'__BEGIN_DECLS'
__BEGIN_DECLS
^
/usr/include/sys/cpuset.h:156:12: error: unknown type name 'cpusetid_t';
did you mean 'cpuset_t'?
int cpuset(cpusetid_t *);
and so forth.
Signed-off-by: Roman Bogorodskiy <bogorodskiy(a)gmail.com>
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index e4f36e8574..ad0cd44aca 100644
--- a/meson.build
+++ b/meson.build
@@ -709,7 +709,7 @@ if (cc.has_header_symbol('net/if_bridgevar.h', 'BRDGSFD', prefix: brd_required_h
endif
# Check for BSD CPU affinity availability
-if cc.has_header_symbol('sys/cpuset.h', 'cpuset_getaffinity')
+if cc.has_header_symbol('sys/cpuset.h', 'cpuset_getaffinity', prefix: '#include <sys/param.h>')
conf.set('WITH_BSD_CPU_AFFINITY', 1)
endif
--
2.33.1
3 years, 1 month
[PATCH] meson: improve CPU affinity routines check
by Roman Bogorodskiy
Recently, FreeBSD has got sched_get/setaffinity(3) implementations and
the sched.h header as well [1]. To make these routines visible,
users have to define _WITH_CPU_SET_T.
This breaks current detection. Specifically, meson sees the
sched_getaffinity() symbol and defines WITH_SCHED_GETAFFINITY. This
define unlocks Linux implementation of virProcessSetAffinity() and other
functions, which fails to build on FreeBSD because cpu_set_t is not
visible as _WITH_CPU_SET_T is not defined.
For now, change detection to the following:
- Instead of checking sched_getaffinity(), check if 'cpu_set_t' is
available through sched.h
- Explicitly check the sched.h header instead of assuming its presence
if WITH_SCHED_SETSCHEDULER is defined
1:
https://cgit.freebsd.org/src/commit/?id=43736b71dd051212d5c55be9fa21c4599...
https://cgit.freebsd.org/src/commit/?id=160b4b922b6021848b6b48afc894d16b8...
https://cgit.freebsd.org/src/commit/?id=90fa9705d5cd29cf11c5dc7319299788d...
Signed-off-by: Roman Bogorodskiy <bogorodskiy(a)gmail.com>
---
meson.build | 4 +++-
src/util/virprocess.c | 8 ++++----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/meson.build b/meson.build
index 9022bcfdc9..e4f36e8574 100644
--- a/meson.build
+++ b/meson.build
@@ -553,7 +553,6 @@ functions = [
'posix_fallocate',
'posix_memalign',
'prlimit',
- 'sched_getaffinity',
'sched_setscheduler',
'setgroups',
'setns',
@@ -602,6 +601,7 @@ headers = [
'net/if.h',
'pty.h',
'pwd.h',
+ 'sched.h',
'sys/auxv.h',
'sys/ioctl.h',
'sys/mount.h',
@@ -671,6 +671,8 @@ symbols = [
# Check for BSD approach for setting MAC addr
[ 'net/if_dl.h', 'link_addr', '#include <sys/types.h>\n#include <sys/socket.h>' ],
+
+ [ 'sched.h', 'cpu_set_t' ],
]
if host_machine.system() == 'linux'
diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index 6de3f36f52..81de90200e 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -35,7 +35,7 @@
# include <sys/time.h>
# include <sys/resource.h>
#endif
-#if WITH_SCHED_SETSCHEDULER
+#if WITH_SCHED_H
# include <sched.h>
#endif
@@ -480,7 +480,7 @@ int virProcessKillPainfully(pid_t pid, bool force)
return virProcessKillPainfullyDelay(pid, force, 0, false);
}
-#if WITH_SCHED_GETAFFINITY
+#if WITH_DECL_CPU_SET_T
int virProcessSetAffinity(pid_t pid, virBitmap *map, bool quiet)
{
@@ -626,7 +626,7 @@ virProcessGetAffinity(pid_t pid)
return ret;
}
-#else /* WITH_SCHED_GETAFFINITY */
+#else /* WITH_DECL_CPU_SET_T */
int virProcessSetAffinity(pid_t pid G_GNUC_UNUSED,
virBitmap *map G_GNUC_UNUSED,
@@ -646,7 +646,7 @@ virProcessGetAffinity(pid_t pid G_GNUC_UNUSED)
_("Process CPU affinity is not supported on this platform"));
return NULL;
}
-#endif /* WITH_SCHED_GETAFFINITY */
+#endif /* WITH_DECL_CPU_SET_T */
int virProcessGetPids(pid_t pid, size_t *npids, pid_t **pids)
--
2.33.1
3 years, 1 month
[PATCH v2 0/2] Fix /proc/*/stat parsing
by Martin Kletzander
While working on some polkit stuff I found out that we are inconsistent with the
way we parse /proc/*/stat files, so I added a new helper instead along with some
tests. Unfortunately using it for the thing I wanted is not really viable in
the end, so it "violates" the Rule of three, but at least it does something
correctly.
v2:
- Fixed open64 by just using virFileReadAllQuiet instead of g_file_get_contents
- Removed some leftover unused variables
- Still do not know why my cirrus builds fail
v1:
- https://listman.redhat.com/archives/libvir-list/2021-November/msg00580.html
Martin Kletzander (2):
util: Add virProcessGetStat
Use virProcessGetStat
src/libvirt_linux.syms | 3 +
src/qemu/qemu_driver.c | 33 ++-----
src/util/virprocess.c | 126 +++++++++++++++++---------
src/util/virprocess.h | 4 +
tests/meson.build | 1 +
tests/virprocessstatdata/complex/stat | 2 +
tests/virprocessstatdata/simple/stat | 1 +
tests/virprocessstattest.c | 84 +++++++++++++++++
8 files changed, 185 insertions(+), 69 deletions(-)
create mode 100644 tests/virprocessstatdata/complex/stat
create mode 100644 tests/virprocessstatdata/simple/stat
create mode 100644 tests/virprocessstattest.c
--
2.34.0
3 years, 1 month