From patchwork Sat Mar 20 21:31:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierre Langlois X-Patchwork-Id: 27992 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 976E527BC57; Sat, 20 Mar 2021 21:32:18 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D639327BC5C for ; Sat, 20 Mar 2021 21:32:15 +0000 (GMT) Received: from localhost ([::1]:36398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNjCh-0007Jz-0N for patchwork@mira.cbaines.net; Sat, 20 Mar 2021 17:32:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNjCV-0007In-Kq for guix-patches@gnu.org; Sat, 20 Mar 2021 17:32:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41687) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lNjCU-0002iW-P3 for guix-patches@gnu.org; Sat, 20 Mar 2021 17:32:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lNjCU-0004sK-M6 for guix-patches@gnu.org; Sat, 20 Mar 2021 17:32:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47285] [PATCH 1/4] gnu: libvirt: Update to 7.1.0. Resent-From: Pierre Langlois Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 20 Mar 2021 21:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47285 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 47285@debbugs.gnu.org Cc: Pierre Langlois Received: via spool by 47285-submit@debbugs.gnu.org id=B47285.161627590818697 (code B ref 47285); Sat, 20 Mar 2021 21:32:02 +0000 Received: (at 47285) by debbugs.gnu.org; 20 Mar 2021 21:31:48 +0000 Received: from localhost ([127.0.0.1]:53228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lNjCG-0004rN-8J for submit@debbugs.gnu.org; Sat, 20 Mar 2021 17:31:48 -0400 Received: from mout.gmx.net ([212.227.17.22]:58087) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lNjC3-0004qd-97 for 47285@debbugs.gnu.org; Sat, 20 Mar 2021 17:31:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1616275888; bh=PjB6VlbNrEWGsIV7ofNL826dHiwfGUh7QX1i0IlNy9w=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=IzhGRO0/wSQw4Jy5EVDc+E9/Ky6sih9uos4XttwSBT2FTdauHTzDuNQcmkH5/Z4nn ItWIFmjZC7eM2Phf9pIGR+9nsJPQGjvvWvcXoFuzjyfNlRTLDx1rJWTvg4OoU6bhbx lyvacWIrg0L2OB9SLVqefP44oHte6d+5tIe2Ngoc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([82.69.64.142]) by mail.gmx.net (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MS3mt-1lGk7X13pD-00TRoT; Sat, 20 Mar 2021 22:31:28 +0100 From: Pierre Langlois Date: Sat, 20 Mar 2021 21:31:22 +0000 Message-Id: <20210320213125.11295-1-pierre.langlois@gmx.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <87o8fdwmdn.fsf@gmx.com> References: <87o8fdwmdn.fsf@gmx.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:Xq2A1Igjr+FKbJEkQdh4mhAQhD745Id4+ljJ7r/xyR4Q4cJBkQb 4uzZkgsSEuljbOt3yINSqT4zqFRQOX8+1bMw9PWqSim1+/C/WDCsjV12xkDYKguEq1yDt+d +SBs/8Wxa0CiZF1++KO5FtG+LKusOAHPHI2nMWBJHOwWrHPt8GsFOHwNmyh1NWhLQP7GclJ JJe6KGmdEranuz3e9/w3w== X-UI-Out-Filterresults: notjunk:1;V03:K0:FbhrL3kWqQQ=:Jhz2xS0ZU8VKGEbRpJVEmA ziysGeDzQbdIuCWO6majY+WVaLBRh2eSjjWjAgv1hLVGR67Y3tTPiVWPN2xaIpL81VzCmRb3h cd2gM26cU+qbqBs65NwzST8sS+Sve65+AX0d3PX1gHXusM9Wx6t1o9OVvRgRXOtlVK/FmN7rA 0ETa577VgCCJk2e/QD0m0oKtGn//Jp+ZdWmZnz3EWn1lYXjak83TSnmuhCu7GgAVI6kv4mobh wylcfmaDKbcFmhKElDq1iEzAwacdcb1wyIOF/94mm2ji3EP2aNb0v3aBR/jvbMSfD7HLu0dYV jy5PJyjhCiQw/TOlGFPHNS/BMYwElaQDXFHfTY9HFzlKrPop1VhpSrFeyeG6cCWLVsH79Ug23 7uog/czi5SpCgHenIM4oY81mom1Ir4CfZN3GquWcNKBKanPJQWq844g6IECJb3Fcy4+z1rG2v bFttUBotUMi3DT0JxZ5YkV5GrZ7GjFwHlRmoxFebafTFsyQOqvLgtUttc73NngWa1of/bk+wp Syuu9L9na9L8yhG2YwuoE2ykEk2FQ4pNXhyit6nexQdhLtzuNfAGlqZFEKVu+qTwccdrDWFeM 0i0ttiHJXGBa4w63rAvlbNEBYWupeLmTzYh8XeTcJt1VhScReXcS7oQdgcAYot6xsODnMtthV 6g/GBBDHfbYjMwNM3T6avkt+ZNDX4p0HrfXkgD4A03Du++w6ABMpCNCDdSBshJn+T5ysM6JvE CmdvtGdLMOJmkhWGoV8aPvGFuAkZ6lVuHiEvWR2BB3ajokCRdDwOxADTdAlq8xreXRUu7nY+x WbYW9rWjFX2oXNyzE6nQEAFFjZ++GRc4LHtXn7F0LbIQKo86WW2rWAb7WDogqpMEXT5bUiobq vdBCap6jj63ehHerkR7Q== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/virtualization.scm (libvirt): Update to 7.1.0. [source]: Remove libvirt-create-machine-cgroup.patch, add libvirt-do-not-create-var-dirs.patch. [build-system]: Switch to meson-build-system. [arguments]: Use meson-0.55. Adapt #:configure-flags for meson, there is no need for --docdir anymore. Remove fix-BOURNE_SHELL-definition phase. Add fix-sysconfdir-and-localstatedir phase. Adapt disable-broken-tests to meson. [native-inputs]: Add python-docutils and rpcsvc-proto. * gnu/packages/patches/libvirt-create-machine-cgroup.patch: Delete. * gnu/packages/patches/libvirt-do-not-create-var-dirs.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add new patch, remove the other. --- gnu/local.mk | 2 +- .../libvirt-create-machine-cgroup.patch | 48 ------------ .../libvirt-do-not-create-var-dirs.patch | 30 +++++++ gnu/packages/virtualization.scm | 78 ++++++++----------- 4 files changed, 64 insertions(+), 94 deletions(-) delete mode 100644 gnu/packages/patches/libvirt-create-machine-cgroup.patch create mode 100644 gnu/packages/patches/libvirt-do-not-create-var-dirs.patch -- 2.31.0 diff --git a/gnu/local.mk b/gnu/local.mk index 3d4147a879..cd755f5d67 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1257,7 +1257,7 @@ dist_patch_DATA = \ %D%/packages/patches/kdbusaddons-kinit-file-name.patch \ %D%/packages/patches/libffi-3.3-powerpc-fixes.patch \ %D%/packages/patches/libffi-float128-powerpc64le.patch \ - %D%/packages/patches/libvirt-create-machine-cgroup.patch \ + %D%/packages/patches/libvirt-do-not-create-var-dirs.patch \ %D%/packages/patches/libziparchive-add-includes.patch \ %D%/packages/patches/localed-xorg-keyboard.patch \ %D%/packages/patches/kdiagram-Fix-missing-link-libraries.patch \ diff --git a/gnu/packages/patches/libvirt-create-machine-cgroup.patch b/gnu/packages/patches/libvirt-create-machine-cgroup.patch deleted file mode 100644 index 585ac237e1..0000000000 --- a/gnu/packages/patches/libvirt-create-machine-cgroup.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 9ca0b2955edea162b255b428e493cd8ffac52167 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= - -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 - diff --git a/gnu/packages/patches/libvirt-do-not-create-var-dirs.patch b/gnu/packages/patches/libvirt-do-not-create-var-dirs.patch new file mode 100644 index 0000000000..640cb1696d --- /dev/null +++ b/gnu/packages/patches/libvirt-do-not-create-var-dirs.patch @@ -0,0 +1,30 @@ +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' diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index fabac5b984..86a95b77f1 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -18,6 +18,7 @@ ;;; Copyright © 2020, 2021 Maxim Cournoyer ;;; Copyright © 2020 Brett Gilio ;;; Copyright © 2021 Leo Famulari +;;; Copyright © 2021 Pierre Langlois ;;; ;;; This file is part of GNU Guix. ;;; @@ -1065,64 +1066,49 @@ manage system or application containers.") (define-public libvirt (package (name "libvirt") - (version "5.8.0") + (version "7.1.0") (source (origin (method url-fetch) (uri (string-append "https://libvirt.org/sources/libvirt-" version ".tar.xz")) (sha256 - (base32 "0m8cqaqflvys5kaqpvb0qr4k365j09jc5xk6x70yvg8qkcl2hcz2")) + (base32 "0v50ckf56h6jd9bmqwp0lh2cmb7qqjmcb6y3mz2i2r15h06ih3w7")) (patches - (search-patches "libvirt-create-machine-cgroup.patch")))) - (build-system gnu-build-system) + (search-patches "libvirt-do-not-create-var-dirs.patch")))) + (build-system meson-build-system) (arguments - `(#:configure-flags - (list "--with-qemu" - "--with-qemu-user=nobody" - "--with-qemu-group=kvm" - "--with-polkit" - (string-append "--docdir=" (assoc-ref %outputs "out") "/share/doc/" - ,name "-" ,version) - "--sysconfdir=/etc" - "--localstatedir=/var") + `(#:meson ,meson-0.55 ;; libvirt requires meson 0.54 or higher. + #:configure-flags + (list "-Ddriver_qemu=enabled" + "-Dqemu_user=nobody" + "-Dqemu_group=kvm" + "-Dpolkit=enabled") #:phases (modify-phases %standard-phases - (add-before 'configure 'fix-BOURNE_SHELL-definition - ;; BOURNE_SHELL is hard-#defined to ‘/bin/sh’, causing test failures. + (add-after 'unpack 'fix-sysconfdir-and-localstatedir (lambda _ - (substitute* "config.h.in" - (("/bin/sh") (which "sh"))) - #t)) - (add-before 'configure 'patch-libtirpc-file-names - (lambda* (#:key inputs #:allow-other-keys) - ;; libvirt uses an m4 macro instead of pkg-config to determine where - ;; the RPC headers are located. Tell it to look in the right place. - (substitute* "configure" - (("/usr/include/tirpc") ;defined in m4/virt-xdr.m4 - (string-append (assoc-ref inputs "libtirpc") - "/include/tirpc"))) + (substitute* "meson.build" + ;; We set the prefix to be the package output, but we need + ;; localstatedir to be /var. Sadly the build system doesn't + ;; seem to allow that easily. + (("localstatedir = prefix / get_option\\('localstatedir'\\)") + "localstatedir = get_option('localstatedir')") + ;; On the other hand, we keep sysconfdir using the prefix so + ;; that we install configuration files in the package output. + ;; However, we need to make sure the C code refers to /etc via + ;; SYSCONFDIR, and not the read-only configuration in the + ;; package output. + (("set_quoted\\('SYSCONFDIR', sysconfdir\\)") + "set_quoted('SYSCONFDIR', '/etc')")) #t)) (add-before 'configure 'disable-broken-tests (lambda _ - (let ((tests (list "commandtest" ; hangs idly - "qemuxml2argvtest" ; fails - "qemuhotplugtest" ; fails - "virnetsockettest" ; tries to network - "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)))))) + (substitute* "tests/meson.build" + (("\\{ 'name': 'commandtest'.*") "") ; hangs idly + (("\\{ 'name': 'qemuxml2argvtest'.*") "") ; fails + (("\\{ 'name': 'virnetsockettest'.*") "")) ; tries to network + #t))))) (inputs `(("libxml2" ,libxml2) ("eudev" ,eudev) @@ -1149,7 +1135,9 @@ manage system or application containers.") ("perl" ,perl) ("pkg-config" ,pkg-config) ("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") (synopsis "Simple API for virtualization") (description "Libvirt is a C toolkit to interact with the virtualization