public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server v2 1/2] vm-network-scripts: move scripts to /usr/libexec
@ 2025-02-18 13:32 Maximiliano Sandoval
  2025-02-18 13:32 ` [pve-devel] [PATCH qemu-server v2 2/2] test: Adapt to changes in network scripts location Maximiliano Sandoval
  2025-04-07 14:04 ` [pve-devel] applied: [PATCH qemu-server v2 1/2] vm-network-scripts: move scripts to /usr/libexec Thomas Lamprecht
  0 siblings, 2 replies; 4+ messages in thread
From: Maximiliano Sandoval @ 2025-02-18 13:32 UTC (permalink / raw)
  To: pve-devel

Moves the network scripts from /var/lib/qemu-server into
/usr/libexec/qemu-server.

/usr/libexec is described as binaries run by programs which are not
intended to be directly executed by the user on [FHS 4.7]. On the other
hand /var/lib corresponds to variable state information, which does not
fit the use case here, see [FHS 5.8].

For the sake of preventing race conditions we ship both versions until
version 9.

[FHS 4.7]: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s07.html
[FHS 5.8]: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s08.html

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---

Differences from v1:
 - Ship both versions until v9 to prevent race conditions.
 - Rebase

 PVE/QemuServer.pm                     | 4 ++--
 vm-network-scripts/Makefile           | 6 ++++++
 vm-network-scripts/pve-bridge-hotplug | 2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 808c0e1c..46b588b7 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -1674,8 +1674,8 @@ sub print_netdev_full {
     my $script = $hotplug ? "pve-bridge-hotplug" : "pve-bridge";
 
     if ($net->{bridge}) {
-	$netdev = "type=tap,id=$netid,ifname=${ifname},script=/var/lib/qemu-server/$script"
-	    .",downscript=/var/lib/qemu-server/pve-bridgedown$vhostparam";
+	$netdev = "type=tap,id=$netid,ifname=${ifname},script=/usr/libexec/qemu-server/$script"
+	    .",downscript=/usr/libexec/qemu-server/pve-bridgedown$vhostparam";
     } else {
         $netdev = "type=user,id=$netid,hostname=$vmname";
     }
diff --git a/vm-network-scripts/Makefile b/vm-network-scripts/Makefile
index 5ba537d0..61733e2d 100644
--- a/vm-network-scripts/Makefile
+++ b/vm-network-scripts/Makefile
@@ -1,8 +1,14 @@
 DESTDIR=
+LIBEXECDIR=$(DESTDIR)/usr/libexec/qemu-server
+# Remove with version 9
 VARLIBDIR=$(DESTDIR)/var/lib/qemu-server
 
 .PHONY: install
 install: pve-bridge pve-bridge-hotplug pve-bridgedown
+	install -d ${LIBEXECDIR}
+	install -m 0755 pve-bridge ${LIBEXECDIR}/pve-bridge
+	install -m 0755 pve-bridge-hotplug ${LIBEXECDIR}/pve-bridge-hotplug
+	install -m 0755 pve-bridgedown ${LIBEXECDIR}/pve-bridgedown
 	install -d ${VARLIBDIR}
 	install -m 0755 pve-bridge ${VARLIBDIR}/pve-bridge
 	install -m 0755 pve-bridge-hotplug ${VARLIBDIR}/pve-bridge-hotplug
diff --git a/vm-network-scripts/pve-bridge-hotplug b/vm-network-scripts/pve-bridge-hotplug
index f36ed408..3ae01ea5 100755
--- a/vm-network-scripts/pve-bridge-hotplug
+++ b/vm-network-scripts/pve-bridge-hotplug
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-exec /var/lib/qemu-server/pve-bridge --hotplug "$@"
+exec /usr/libexec/qemu-server/pve-bridge --hotplug "$@"
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-04-07 15:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-18 13:32 [pve-devel] [PATCH qemu-server v2 1/2] vm-network-scripts: move scripts to /usr/libexec Maximiliano Sandoval
2025-02-18 13:32 ` [pve-devel] [PATCH qemu-server v2 2/2] test: Adapt to changes in network scripts location Maximiliano Sandoval
2025-04-07 15:31   ` Thomas Lamprecht
2025-04-07 14:04 ` [pve-devel] applied: [PATCH qemu-server v2 1/2] vm-network-scripts: move scripts to /usr/libexec Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal