[libvirt] [ocaml PATCH] Cast virError* enums to int for comparisons with 0
by Pino Toscano
The actual type of an enum in C is implementation defined when there are
no negative values, and thus it can be int, or uint. This is the case
of the virError* enums in libvirt, as they do not have negative values.
Hence, to avoid hitting tautological comparison errors when checking
their rage, temporarly cast the enum values to int when checking they
are not negative. The check is there to ensure the value is within the
range of the OCaml type used to represent it.
Signed-off-by: Pino Toscano <ptoscano(a)redhat.com>
---
libvirt/libvirt_c_epilogue.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libvirt/libvirt_c_epilogue.c b/libvirt/libvirt_c_epilogue.c
index 29656a4..4e75d2f 100644
--- a/libvirt/libvirt_c_epilogue.c
+++ b/libvirt/libvirt_c_epilogue.c
@@ -153,7 +153,7 @@ Val_err_number (virErrorNumber code)
CAMLparam0 ();
CAMLlocal1 (rv);
- if (0 <= code && code <= MAX_VIR_CODE)
+ if (0 <= (int) code && code <= MAX_VIR_CODE)
rv = Val_int (code);
else {
rv = caml_alloc (1, 0); /* VIR_ERR_UNKNOWN (code) */
@@ -169,7 +169,7 @@ Val_err_domain (virErrorDomain code)
CAMLparam0 ();
CAMLlocal1 (rv);
- if (0 <= code && code <= MAX_VIR_DOMAIN)
+ if (0 <= (int) code && code <= MAX_VIR_DOMAIN)
rv = Val_int (code);
else {
rv = caml_alloc (1, 0); /* VIR_FROM_UNKNOWN (code) */
@@ -185,7 +185,7 @@ Val_err_level (virErrorLevel code)
CAMLparam0 ();
CAMLlocal1 (rv);
- if (0 <= code && code <= MAX_VIR_LEVEL)
+ if (0 <= (int) code && code <= MAX_VIR_LEVEL)
rv = Val_int (code);
else {
rv = caml_alloc (1, 0); /* VIR_ERR_UNKNOWN_LEVEL (code) */
--
2.17.2
6 years
[libvirt] [jenkins-ci PATCH v2] Don't run libvirt-dbus-syntax-check on FreeBSD
by Andrea Bolognani
flake8 3.5.0 doesn't work with pyflakes 2.0.0, and since those
are the versions available through ports there's currently no
way to successfully run flake8 on FreeBSD.
We will be able to revert this once flake8 3.6.0 is available
through ports.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
guests/playbooks/build/projects/libvirt-dbus.yml | 7 +++----
projects/libvirt-dbus.yaml | 7 +++----
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/guests/playbooks/build/projects/libvirt-dbus.yml b/guests/playbooks/build/projects/libvirt-dbus.yml
index 1d4ecbd..41e670c 100644
--- a/guests/playbooks/build/projects/libvirt-dbus.yml
+++ b/guests/playbooks/build/projects/libvirt-dbus.yml
@@ -21,16 +21,15 @@
- include: '{{ playbook_base }}/jobs/autotools-build-job.yml'
- include: '{{ playbook_base }}/jobs/autotools-syntax-check-job.yml'
vars:
- # CentOS 7 doesn't include Python 3 and the version of pyflakes
- # in FreeBSD CURRENT is too new to be used by flake8
+ # CentOS 7 doesn't include Python 3, while the versions of flake8
+ # and pyflakes currently available on FreeBSD (3.5.0 and 2.0.0
+ # respectively) are not compatible
machines:
- libvirt-debian-9
- libvirt-debian-sid
- libvirt-fedora-28
- libvirt-fedora-29
- libvirt-fedora-rawhide
- - libvirt-freebsd-10
- - libvirt-freebsd-11
- libvirt-ubuntu-16
- libvirt-ubuntu-18
- include: '{{ playbook_base }}/jobs/autotools-check-job.yml'
diff --git a/projects/libvirt-dbus.yaml b/projects/libvirt-dbus.yaml
index 48bbdaa..3d1ed9c 100644
--- a/projects/libvirt-dbus.yaml
+++ b/projects/libvirt-dbus.yaml
@@ -18,15 +18,14 @@
parent_jobs: 'libvirt-glib-build'
- autotools-syntax-check-job:
parent_jobs: 'libvirt-dbus-build'
- # CentOS 7 doesn't include Python 3 and the version of pyflakes
- # in FreeBSD CURRENT is too new to be used by flake8
+ # CentOS 7 doesn't include Python 3, while the versions of flake8
+ # and pyflakes currently available on FreeBSD (3.5.0 and 2.0.0
+ # respectively) are not compatible
machines:
- libvirt-debian-9
- libvirt-fedora-28
- libvirt-fedora-29
- libvirt-fedora-rawhide
- - libvirt-freebsd-10
- - libvirt-freebsd-11
- autotools-check-job:
parent_jobs: 'libvirt-dbus-syntax-check'
# CentOS 7 doesn't include Python 3 and the version in Ubuntu
--
2.19.1
6 years
[libvirt] [jenkins-ci PATCH] Don't run libvirt-dbus-syntax-check on FreeBSD
by Andrea Bolognani
flake8 wants 'pyflakes<1.7.0,>=1.5.0', but all FreeBSD
releases ship pyflakes 2.0.0 these days.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
guests/playbooks/build/projects/libvirt-dbus.yml | 4 +---
projects/libvirt-dbus.yaml | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/guests/playbooks/build/projects/libvirt-dbus.yml b/guests/playbooks/build/projects/libvirt-dbus.yml
index 1d4ecbd..61ece63 100644
--- a/guests/playbooks/build/projects/libvirt-dbus.yml
+++ b/guests/playbooks/build/projects/libvirt-dbus.yml
@@ -22,15 +22,13 @@
- include: '{{ playbook_base }}/jobs/autotools-syntax-check-job.yml'
vars:
# CentOS 7 doesn't include Python 3 and the version of pyflakes
- # in FreeBSD CURRENT is too new to be used by flake8
+ # in FreeBSD is too new to be used by flake8
machines:
- libvirt-debian-9
- libvirt-debian-sid
- libvirt-fedora-28
- libvirt-fedora-29
- libvirt-fedora-rawhide
- - libvirt-freebsd-10
- - libvirt-freebsd-11
- libvirt-ubuntu-16
- libvirt-ubuntu-18
- include: '{{ playbook_base }}/jobs/autotools-check-job.yml'
diff --git a/projects/libvirt-dbus.yaml b/projects/libvirt-dbus.yaml
index 48bbdaa..49f5366 100644
--- a/projects/libvirt-dbus.yaml
+++ b/projects/libvirt-dbus.yaml
@@ -19,14 +19,12 @@
- autotools-syntax-check-job:
parent_jobs: 'libvirt-dbus-build'
# CentOS 7 doesn't include Python 3 and the version of pyflakes
- # in FreeBSD CURRENT is too new to be used by flake8
+ # in FreeBSD is too new to be used by flake8
machines:
- libvirt-debian-9
- libvirt-fedora-28
- libvirt-fedora-29
- libvirt-fedora-rawhide
- - libvirt-freebsd-10
- - libvirt-freebsd-11
- autotools-check-job:
parent_jobs: 'libvirt-dbus-syntax-check'
# CentOS 7 doesn't include Python 3 and the version in Ubuntu
--
2.19.1
6 years
[libvirt] [PATCH 0/2] conf: qemu: support new Hyper-V enlightenments in Qemu-3.1
by Vitaly Kuznetsov
The upcoming Qemu-3.1 release will bring us two new Hyper-V enlightenments:
hv_ipi and hv_evmcs. Support these in libvirt.
Vitaly Kuznetsov (2):
conf: qemu: add support for Hyper-V PV IPIs
conf: qemu: add support for Hyper-V Enlightened VMCS
docs/formatdomain.html.in | 14 ++++++++++++++
docs/schemas/domaincommon.rng | 10 ++++++++++
src/conf/domain_conf.c | 10 +++++++++-
src/conf/domain_conf.h | 2 ++
src/cpu/cpu_x86.c | 6 ++++++
src/cpu/cpu_x86_data.h | 2 ++
src/qemu/qemu_command.c | 2 ++
src/qemu/qemu_parse_command.c | 2 ++
src/qemu/qemu_process.c | 2 ++
tests/qemuxml2argvdata/hyperv-off.xml | 2 ++
tests/qemuxml2argvdata/hyperv.args | 2 +-
tests/qemuxml2argvdata/hyperv.xml | 2 ++
tests/qemuxml2xmloutdata/hyperv-off.xml | 2 ++
tests/qemuxml2xmloutdata/hyperv.xml | 2 ++
14 files changed, 58 insertions(+), 2 deletions(-)
--
2.17.2
6 years
[libvirt] [PATCH v3 00/13] Implement alternative metadata locking
by Michal Privoznik
v3 of:
https://www.redhat.com/archives/libvir-list/2018-October/msg00667.html
diff to v2:
- Introduced two new patches (1/13 and 2/13) so that even non-Linux
platforms are covered
- In 4/13 I switched from indefinite wait for lock to a lock with
timeout (of 10 seconds). This is basically to prevent us stalling if
some app misbehaves and holds the file locked for eternity.
Michal Prívozník (13):
virprocess: Introduce virProcessRunInFork
virprocess: Make virProcessRunInMountNamespace use virProcessRunInFork
security: Always spawn process for transactions
security_manager: Rework metadata locking
Revert "security_manager: Load lock plugin on init"
Revert "qemu_conf: Introduce metadata_lock_manager"
Revert "lock_manager: Allow disabling configFile for
virLockManagerPluginNew"
Revert "lock_driver: Introduce VIR_LOCK_MANAGER_ACQUIRE_ROLLBACK"
Revert "lock_driver: Introduce
VIR_LOCK_MANAGER_RESOURCE_TYPE_METADATA"
Revert "_virLockManagerLockDaemonPrivate: Move @hasRWDisks into dom
union"
Revert "lock_driver: Introduce new
VIR_LOCK_MANAGER_OBJECT_TYPE_DAEMON"
Revert "lock_driver_lockd: Introduce
VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_METADATA flag"
Revert "virlockspace: Allow caller to specify start and length offset
in virLockSpaceAcquireResource"
cfg.mk | 4 +-
src/libvirt_private.syms | 1 +
src/locking/lock_daemon_dispatch.c | 11 +-
src/locking/lock_driver.h | 12 -
src/locking/lock_driver_lockd.c | 421 ++++++++++-------------------
src/locking/lock_driver_lockd.h | 1 -
src/locking/lock_driver_sanlock.c | 44 +--
src/locking/lock_manager.c | 10 +-
src/lxc/lxc_controller.c | 3 +-
src/lxc/lxc_driver.c | 2 +-
src/qemu/qemu_conf.c | 1 -
src/qemu/qemu_conf.h | 1 -
src/qemu/qemu_driver.c | 3 -
src/security/security_dac.c | 12 +-
src/security/security_manager.c | 250 +++++++++--------
src/security/security_manager.h | 19 +-
src/security/security_selinux.c | 11 +-
src/util/virlockspace.c | 15 +-
src/util/virlockspace.h | 4 -
src/util/virprocess.c | 69 ++++-
src/util/virprocess.h | 16 ++
tests/seclabeltest.c | 2 +-
tests/securityselinuxlabeltest.c | 2 +-
tests/securityselinuxtest.c | 2 +-
tests/testutilsqemu.c | 2 +-
tests/virlockspacetest.c | 29 +-
26 files changed, 387 insertions(+), 560 deletions(-)
--
2.18.1
6 years
[libvirt] [PATCH] examples: Add missing quotes
by Andrea Bolognani
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Pushed as trivial.
examples/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 7069d74e74..8a9c118858 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -94,7 +94,7 @@ install-apparmor-local:
$(MKDIR_P) "$(APPARMOR_LOCAL_DIR)"
echo "# Site-specific additions and overrides for \
'usr.lib.libvirt.virt-aa-helper'" \
- >$(APPARMOR_LOCAL_DIR)/usr.lib.libvirt.virt-aa-helper
+ >"$(APPARMOR_LOCAL_DIR)/usr.lib.libvirt.virt-aa-helper"
INSTALL_DATA_LOCAL += install-apparmor-local
UNINSTALL_LOCAL += uninstall-apparmor-local
--
2.19.1
6 years
[libvirt] [PATCH] build: Fix uninstall when WITH_APPARMOR_PROFILES is defined
by Jim Fehlig
When libvirt configuration includes '--with-apparmor-profiles', the
make uninstall target fails
make[1]: Entering directory '/home/jim/upstream/libvirt/examples'
( cd '/etc/apparmor.d//abstractions' && rm -f libvirt-qemu libvirt-lxc )
( cd '/etc/apparmor.d/' && rm -f usr.lib.libvirt.virt-aa-helper usr.sbin.libvirtd )
make[1]: *** No rule to make target 'uninstall-apparmor-local', needed by
'uninstall-local'. Stop.
Add missing 'uninstall-apparmor-local' target to the examples Makefile.am.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
examples/Makefile.am | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 7069d74e74..27f8b0ef09 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -96,6 +96,10 @@ install-apparmor-local:
'usr.lib.libvirt.virt-aa-helper'" \
>$(APPARMOR_LOCAL_DIR)/usr.lib.libvirt.virt-aa-helper
+uninstall-apparmor-local:
+ rm -f "$(APPARMOR_LOCAL_DIR)/usr.lib.libvirt.virt-aa-helper"
+ rmdir $(APPARMOR_LOCAL_DIR) || :
+
INSTALL_DATA_LOCAL += install-apparmor-local
UNINSTALL_LOCAL += uninstall-apparmor-local
endif WITH_APPARMOR_PROFILES
--
2.18.0
6 years
[libvirt] [PATCH] virSecuritySELinuxTransactionCommit: Don't mask error
by Michal Privoznik
In 4674fc6afd6 I've implemented transactions for selinux driver.
Well, now that I am working in this area I've notice a subtle
bug: @ret is initialized to 0 instead of -1. Facepalm.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
I wonder how this could survive this long (~2y) not being noticed.
src/security/security_selinux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index 467d1e6bfe..c09404f6f8 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -1091,7 +1091,7 @@ virSecuritySELinuxTransactionCommit(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED,
pid_t pid)
{
virSecuritySELinuxContextListPtr list;
- int ret = 0;
+ int ret = -1;
list = virThreadLocalGet(&contextList);
if (!list)
--
2.18.1
6 years
[libvirt] [PATCH] travis: Switch from Docker Hub to quay.io
by Andrea Bolognani
As it's currently impossible for us to create new automated
builds on Docker Hub (see [1]), and quay.io doesn't suffer
from the same problem while still having all the feature we
need, switch to the latter.
[1] https://github.com/docker/hub-feedback/issues/1676
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
.travis.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml
index 56d25b2ecd..55ba340a34 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -46,7 +46,7 @@ script:
-e VIR_TEST_DEBUG="$VIR_TEST_DEBUG"
-e MINGW="$MINGW"
-e DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS"
- "libvirt/buildenv-$IMAGE"
+ "quay.io/libvirt/buildenv-$IMAGE:master"
/bin/sh -xc "$DOCKER_CMD"
git:
--
2.19.1
6 years