meta-virtualization.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
From: Xiangyu Chen <xiangyu.chen@eng.windriver.com>
To: meta-virtualization@lists.yoctoproject.org
Subject: [meta-virtualization][PATCH] libvirt: fix postinstall scriptlets failure
Date: Tue,  6 Feb 2024 19:11:53 +0800	[thread overview]
Message-ID: <20240206111153.3645955-1-xiangyu.chen@eng.windriver.com> (raw)

From: Xiangyu Chen <xiangyu.chen@windriver.com>

libvirt upstream has added all sockets for a service being enabled when a
single one of them is[1], it likes serviceA enable serviceB, serviceB enable
serviceA, that cause our systemctl script[2] trap into a dead loop in postinstall
stage, the error message as below:

Traceback (most recent call last):
  File "/usr/lib/python3.8/pathlib.py", line 722, in __str__
    return self._str
AttributeError: _str

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "recipe-sysroot-native/usr/bin/systemctl", line 255, in enable
    SystemdUnit(self.root, also).enable(unit)
  File "recipe-sysroot-native/usr/bin/systemctl", line 255, in enable
    SystemdUnit(self.root, also).enable(unit)
  File "recipe-sysroot-native/usr/bin/systemctl", line 255, in enable
    SystemdUnit(self.root, also).enable(unit)
  [Previous line repeated 988 more times]
......
RecursionError: maximum recursion depth exceeded while calling a Python object

Since we are using systemctl script to process the dependency, so revert that
commit from upstream.

[1] https://github.com/libvirt/libvirt/commit/826931e95a38af8322f8ad069dc89117c6404a00
[2] https://git.openembedded.org/openembedded-core/tree/meta/recipes-core/systemd/systemd-systemctl/systemctl

Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com>
---
 ...ert-systemd-Add-Also-between-sockets.patch | 143 ++++++++++++++++++
 recipes-extended/libvirt/libvirt_10.0.0.bb    |   1 +
 2 files changed, 144 insertions(+)
 create mode 100644 recipes-extended/libvirt/libvirt/0001-Revert-systemd-Add-Also-between-sockets.patch

diff --git a/recipes-extended/libvirt/libvirt/0001-Revert-systemd-Add-Also-between-sockets.patch b/recipes-extended/libvirt/libvirt/0001-Revert-systemd-Add-Also-between-sockets.patch
new file mode 100644
index 00000000..84367fc3
--- /dev/null
+++ b/recipes-extended/libvirt/libvirt/0001-Revert-systemd-Add-Also-between-sockets.patch
@@ -0,0 +1,143 @@
+From 66aa101abb639c64f71a2867424fb58a39a3bd21 Mon Sep 17 00:00:00 2001
+From: Xiangyu Chen <xiangyu.chen@windriver.com>
+Date: Tue, 6 Feb 2024 18:45:53 +0800
+Subject: [PATCH] Revert "systemd: Add Also between sockets"
+
+This reverts commit 826931e95a38af8322f8ad069dc89117c6404a00.
+
+We have systemctl script to process the service dependency, this cause our oe-core systemctl script
+trap into a dead loop.
+
+Error as below:
+Traceback (most recent call last):
+  File "/usr/lib/python3.8/pathlib.py", line 722, in __str__
+    return self._str
+AttributeError: _str
+
+During handling of the above exception, another exception occurred:
+Traceback (most recent call last):
+  File "recipe-sysroot-native/usr/bin/systemctl", line 255, in enable
+    SystemdUnit(self.root, also).enable(unit)
+  File "recipe-sysroot-native/usr/bin/systemctl", line 255, in enable
+    SystemdUnit(self.root, also).enable(unit)
+  File "recipe-sysroot-native/usr/bin/systemctl", line 255, in enable
+    SystemdUnit(self.root, also).enable(unit)
+  [Previous line repeated 988 more times]
+......
+RecursionError: maximum recursion depth exceeded while calling a Python object
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com>
+---
+ src/locking/virtlockd-admin.socket.in | 1 -
+ src/locking/virtlockd.socket.in       | 1 -
+ src/logging/virtlogd-admin.socket.in  | 1 -
+ src/logging/virtlogd.socket.in        | 1 -
+ src/remote/libvirtd-admin.socket.in   | 2 --
+ src/remote/libvirtd-ro.socket.in      | 2 --
+ src/remote/libvirtd.socket.in         | 2 --
+ src/virtd-admin.socket.in             | 2 --
+ src/virtd-ro.socket.in                | 2 --
+ src/virtd.socket.in                   | 2 --
+ 10 files changed, 16 deletions(-)
+
+diff --git a/src/locking/virtlockd-admin.socket.in b/src/locking/virtlockd-admin.socket.in
+index ed5b94edba..8902ae4225 100644
+--- a/src/locking/virtlockd-admin.socket.in
++++ b/src/locking/virtlockd-admin.socket.in
+@@ -11,4 +11,3 @@ RemoveOnStop=yes
+ 
+ [Install]
+ WantedBy=sockets.target
+-Also=virtlockd.socket
+diff --git a/src/locking/virtlockd.socket.in b/src/locking/virtlockd.socket.in
+index 4eec90a95e..afd42d124e 100644
+--- a/src/locking/virtlockd.socket.in
++++ b/src/locking/virtlockd.socket.in
+@@ -9,4 +9,3 @@ RemoveOnStop=yes
+ 
+ [Install]
+ WantedBy=sockets.target
+-Also=virtlockd-admin.socket
+diff --git a/src/logging/virtlogd-admin.socket.in b/src/logging/virtlogd-admin.socket.in
+index 7207878008..a634af8942 100644
+--- a/src/logging/virtlogd-admin.socket.in
++++ b/src/logging/virtlogd-admin.socket.in
+@@ -11,4 +11,3 @@ RemoveOnStop=yes
+ 
+ [Install]
+ WantedBy=sockets.target
+-Also=virtlogd.socket
+diff --git a/src/logging/virtlogd.socket.in b/src/logging/virtlogd.socket.in
+index e1d6e30e4d..7c14d03ce4 100644
+--- a/src/logging/virtlogd.socket.in
++++ b/src/logging/virtlogd.socket.in
+@@ -9,4 +9,3 @@ RemoveOnStop=yes
+ 
+ [Install]
+ WantedBy=sockets.target
+-Also=virtlogd-admin.socket
+diff --git a/src/remote/libvirtd-admin.socket.in b/src/remote/libvirtd-admin.socket.in
+index 37efc11357..5cbb83deaa 100644
+--- a/src/remote/libvirtd-admin.socket.in
++++ b/src/remote/libvirtd-admin.socket.in
+@@ -11,5 +11,3 @@ RemoveOnStop=yes
+ 
+ [Install]
+ WantedBy=sockets.target
+-Also=libvirtd.socket
+-Also=libvirtd-ro.socket
+diff --git a/src/remote/libvirtd-ro.socket.in b/src/remote/libvirtd-ro.socket.in
+index 6e1fad2272..7e25498728 100644
+--- a/src/remote/libvirtd-ro.socket.in
++++ b/src/remote/libvirtd-ro.socket.in
+@@ -11,5 +11,3 @@ RemoveOnStop=yes
+ 
+ [Install]
+ WantedBy=sockets.target
+-Also=libvirtd.socket
+-Also=libvirtd-admin.socket
+diff --git a/src/remote/libvirtd.socket.in b/src/remote/libvirtd.socket.in
+index 9cd37dc766..919b874acd 100644
+--- a/src/remote/libvirtd.socket.in
++++ b/src/remote/libvirtd.socket.in
+@@ -9,5 +9,3 @@ RemoveOnStop=yes
+ 
+ [Install]
+ WantedBy=sockets.target
+-Also=libvirtd-ro.socket
+-Also=libvirtd-admin.socket
+diff --git a/src/virtd-admin.socket.in b/src/virtd-admin.socket.in
+index 63eabd70f8..d3b260e5b1 100644
+--- a/src/virtd-admin.socket.in
++++ b/src/virtd-admin.socket.in
+@@ -13,5 +13,3 @@ RemoveOnStop=yes
+ 
+ [Install]
+ WantedBy=sockets.target
+-Also=@service@.socket
+-Also=@service@-ro.socket
+diff --git a/src/virtd-ro.socket.in b/src/virtd-ro.socket.in
+index 3284af5a4a..2f701c8adb 100644
+--- a/src/virtd-ro.socket.in
++++ b/src/virtd-ro.socket.in
+@@ -13,5 +13,3 @@ RemoveOnStop=yes
+ 
+ [Install]
+ WantedBy=sockets.target
+-Also=@service@.socket
+-Also=@service@-admin.socket
+diff --git a/src/virtd.socket.in b/src/virtd.socket.in
+index 502c792e7d..3605b0103e 100644
+--- a/src/virtd.socket.in
++++ b/src/virtd.socket.in
+@@ -11,5 +11,3 @@ RemoveOnStop=yes
+ 
+ [Install]
+ WantedBy=sockets.target
+-Also=@service@-ro.socket
+-Also=@service@-admin.socket
+-- 
+2.25.1
+
diff --git a/recipes-extended/libvirt/libvirt_10.0.0.bb b/recipes-extended/libvirt/libvirt_10.0.0.bb
index 6b19b700..412fb67b 100644
--- a/recipes-extended/libvirt/libvirt_10.0.0.bb
+++ b/recipes-extended/libvirt/libvirt_10.0.0.bb
@@ -32,6 +32,7 @@ SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.xz;name=libvirt \
            file://gnutls-helper.py \
            file://0001-prevent-gendispatch.pl-generating-build-path-in-code.patch \
            file://0001-messon.build-remove-build-path-information-to-avoid-.patch \
+           file://0001-Revert-systemd-Add-Also-between-sockets.patch \
           "
 
 SRC_URI[libvirt.sha256sum] = "8ba2e72ec8bdd2418554a1474c42c35704c30174b7611eaf9a16544b71bcf00a"
-- 
2.25.1



             reply	other threads:[~2024-02-06 10:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 11:11 Xiangyu Chen [this message]
     [not found] <17B13F840D848DD8.26550@lists.yoctoproject.org>
2024-02-21  7:42 ` [meta-virtualization][PATCH] libvirt: fix postinstall scriptlets failure Xiangyu Chen
2024-02-22 15:49   ` Bruce Ashfield

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240206111153.3645955-1-xiangyu.chen@eng.windriver.com \
    --to=xiangyu.chen@eng.windriver.com \
    --cc=meta-virtualization@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).