Archived
1
0
Fork 0

Revert "gnu: libvirt: Update to 7.1.0."

The update causes virsh to fail <https://bugs.gnu.org/47541>.

This reverts commit 383b02a370.
This commit is contained in:
Pierre Langlois 2021-04-01 22:50:56 +01:00
parent d42f6b0916
commit bd9e140856
No known key found for this signature in database
GPG key ID: A8FC9E447F4F7D54
4 changed files with 94 additions and 64 deletions

View file

@ -1263,7 +1263,7 @@ dist_patch_DATA = \
%D%/packages/patches/kdbusaddons-kinit-file-name.patch \ %D%/packages/patches/kdbusaddons-kinit-file-name.patch \
%D%/packages/patches/libffi-3.3-powerpc-fixes.patch \ %D%/packages/patches/libffi-3.3-powerpc-fixes.patch \
%D%/packages/patches/libffi-float128-powerpc64le.patch \ %D%/packages/patches/libffi-float128-powerpc64le.patch \
%D%/packages/patches/libvirt-do-not-create-var-dirs.patch \ %D%/packages/patches/libvirt-create-machine-cgroup.patch \
%D%/packages/patches/libziparchive-add-includes.patch \ %D%/packages/patches/libziparchive-add-includes.patch \
%D%/packages/patches/localed-xorg-keyboard.patch \ %D%/packages/patches/localed-xorg-keyboard.patch \
%D%/packages/patches/kdiagram-Fix-missing-link-libraries.patch \ %D%/packages/patches/kdiagram-Fix-missing-link-libraries.patch \

View file

@ -0,0 +1,48 @@
From 9ca0b2955edea162b255b428e493cd8ffac52167 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?=
<rosen644835@gmail.com>
Date: Fri, 1 Nov 2019 17:29:00 +0100
Subject: [PATCH] vircgroup: Ensure /machine group is associated with its
parent.
Call first virCgroupNew on the parent group virCgroupNewPartition if
it is available on before the creation of the child group. This
ensures that the creation of a first level group on the unified
architecture, as the check at virCgroupV2ParseControllersFile as the
parent file is there.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1760233
---
src/util/vircgroup.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index b46f20abfd..33c61f2d45 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -855,9 +855,6 @@ virCgroupNewPartition(const char *path,
if (virCgroupSetPartitionSuffix(path, &newPath) < 0)
goto cleanup;
- if (virCgroupNew(-1, newPath, NULL, controllers, group) < 0)
- goto cleanup;
-
if (STRNEQ(newPath, "/")) {
char *tmp;
parentPath = g_strdup(newPath);
@@ -868,7 +865,12 @@ virCgroupNewPartition(const char *path,
if (virCgroupNew(-1, parentPath, NULL, controllers, &parent) < 0)
goto cleanup;
+ }
+ if (virCgroupNew(-1, newPath, parent, controllers, group) < 0)
+ goto cleanup;
+
+ if (parent) {
if (virCgroupMakeGroup(parent, *group, create, VIR_CGROUP_NONE) < 0)
goto cleanup;
}
--
2.23.0

View file

@ -1,30 +0,0 @@
We define localstatedir as /var, and so we shouldn't be installing empty
directories there.
diff --git a/src/meson.build b/src/meson.build
index f13b85b74e..58040f2c5d 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -893,22 +893,6 @@ if conf.has('WITH_DTRACE_PROBES')
)
endif
-
-# Install empty directories
-
-virt_install_dirs += [
- localstatedir / 'cache' / 'libvirt',
- localstatedir / 'lib' / 'libvirt' / 'images',
- localstatedir / 'lib' / 'libvirt' / 'filesystems',
- localstatedir / 'lib' / 'libvirt' / 'boot',
-]
-
-meson.add_install_script(
- meson_python_prog.path(), python3_prog.path(), meson_install_dirs_prog.path(),
- virt_install_dirs,
-)
-
-
# Check driver files
if host_machine.system() == 'linux'

View file

@ -18,7 +18,6 @@
;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2020 Brett Gilio <brettg@gnu.org> ;;; Copyright © 2020 Brett Gilio <brettg@gnu.org>
;;; Copyright © 2021 Leo Famulari <leo@famulari.name> ;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -1066,49 +1065,64 @@ manage system or application containers.")
(define-public libvirt (define-public libvirt
(package (package
(name "libvirt") (name "libvirt")
(version "7.1.0") (version "5.8.0")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (string-append "https://libvirt.org/sources/libvirt-" (uri (string-append "https://libvirt.org/sources/libvirt-"
version ".tar.xz")) version ".tar.xz"))
(sha256 (sha256
(base32 "0v50ckf56h6jd9bmqwp0lh2cmb7qqjmcb6y3mz2i2r15h06ih3w7")) (base32 "0m8cqaqflvys5kaqpvb0qr4k365j09jc5xk6x70yvg8qkcl2hcz2"))
(patches (patches
(search-patches "libvirt-do-not-create-var-dirs.patch")))) (search-patches "libvirt-create-machine-cgroup.patch"))))
(build-system meson-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:meson ,meson-0.55 ;; libvirt requires meson 0.54 or higher. `(#:configure-flags
#:configure-flags (list "--with-qemu"
(list "-Ddriver_qemu=enabled" "--with-qemu-user=nobody"
"-Dqemu_user=nobody" "--with-qemu-group=kvm"
"-Dqemu_group=kvm" "--with-polkit"
"-Dpolkit=enabled") (string-append "--docdir=" (assoc-ref %outputs "out") "/share/doc/"
,name "-" ,version)
"--sysconfdir=/etc"
"--localstatedir=/var")
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'unpack 'fix-sysconfdir-and-localstatedir (add-before 'configure 'fix-BOURNE_SHELL-definition
;; BOURNE_SHELL is hard-#defined to /bin/sh, causing test failures.
(lambda _ (lambda _
(substitute* "meson.build" (substitute* "config.h.in"
;; We set the prefix to be the package output, but we need (("/bin/sh") (which "sh")))
;; localstatedir to be /var. Sadly the build system doesn't #t))
;; seem to allow that easily. (add-before 'configure 'patch-libtirpc-file-names
(("localstatedir = prefix / get_option\\('localstatedir'\\)") (lambda* (#:key inputs #:allow-other-keys)
"localstatedir = get_option('localstatedir')") ;; libvirt uses an m4 macro instead of pkg-config to determine where
;; On the other hand, we keep sysconfdir using the prefix so ;; the RPC headers are located. Tell it to look in the right place.
;; that we install configuration files in the package output. (substitute* "configure"
;; However, we need to make sure the C code refers to /etc via (("/usr/include/tirpc") ;defined in m4/virt-xdr.m4
;; SYSCONFDIR, and not the read-only configuration in the (string-append (assoc-ref inputs "libtirpc")
;; package output. "/include/tirpc")))
(("set_quoted\\('SYSCONFDIR', sysconfdir\\)")
"set_quoted('SYSCONFDIR', '/etc')"))
#t)) #t))
(add-before 'configure 'disable-broken-tests (add-before 'configure 'disable-broken-tests
(lambda _ (lambda _
(substitute* "tests/meson.build" (let ((tests (list "commandtest" ; hangs idly
(("\\{ 'name': 'commandtest'.*") "") ; hangs idly "qemuxml2argvtest" ; fails
(("\\{ 'name': 'qemuxml2argvtest'.*") "") ; fails "qemuhotplugtest" ; fails
(("\\{ 'name': 'virnetsockettest'.*") "")) ; tries to network "virnetsockettest" ; tries to network
#t))))) "virshtest"))) ; fails
(substitute* "tests/Makefile.in"
(((format #f "(~a)\\$\\(EXEEXT\\)" (string-join tests "|")))
""))
#t)))
(replace 'install
;; Since the sysconfdir and localstatedir should be /etc and /var
;; at runtime, we must prevent writing to them at installation
;; time.
(lambda* (#:key make-flags #:allow-other-keys)
(apply invoke "make" "install"
"sysconfdir=/tmp/etc"
"localstatedir=/tmp/var"
make-flags))))))
(inputs (inputs
`(("libxml2" ,libxml2) `(("libxml2" ,libxml2)
("eudev" ,eudev) ("eudev" ,eudev)
@ -1135,9 +1149,7 @@ manage system or application containers.")
("perl" ,perl) ("perl" ,perl)
("pkg-config" ,pkg-config) ("pkg-config" ,pkg-config)
("polkit" ,polkit) ("polkit" ,polkit)
("python" ,python-wrapper) ("python" ,python-wrapper)))
("python-docutils" ,python-docutils) ;for rst2html
("rpcsvc-proto" ,rpcsvc-proto))) ;for 'rpcgen'
(home-page "https://libvirt.org") (home-page "https://libvirt.org")
(synopsis "Simple API for virtualization") (synopsis "Simple API for virtualization")
(description "Libvirt is a C toolkit to interact with the virtualization (description "Libvirt is a C toolkit to interact with the virtualization