From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	by lore.proxmox.com (Postfix) with ESMTPS id BA5E11FF15F
	for <inbox@lore.proxmox.com>; Mon, 18 Nov 2024 12:17:10 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 57043DF1E;
	Mon, 18 Nov 2024 12:17:13 +0100 (CET)
From: Markus Frank <m.frank@proxmox.com>
To: pve-devel@lists.proxmox.com
Date: Mon, 18 Nov 2024 12:16:56 +0100
Message-Id: <20241118111700.110077-2-m.frank@proxmox.com>
X-Mailer: git-send-email 2.39.5
In-Reply-To: <20241118111700.110077-1-m.frank@proxmox.com>
References: <20241118111700.110077-1-m.frank@proxmox.com>
MIME-Version: 1.0
X-SPAM-LEVEL: Spam detection results:  0
 AWL -0.024 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
Subject: [pve-devel] [PATCH qemu-server v13 1/5] query-machine-capabilities:
 add systemd service file
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

Add a systemd service that runs the query-machine-capabilities binary
at boot time to ensure that the machine capabilities are stored in the
host-hw-capabilities.json file.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
 query-machine-capabilities/Makefile                 |  2 ++
 .../query-machine-capabilities.service              | 13 +++++++++++++
 2 files changed, 15 insertions(+)
 create mode 100644 query-machine-capabilities/query-machine-capabilities.service

diff --git a/query-machine-capabilities/Makefile b/query-machine-capabilities/Makefile
index 469c69ff..42372370 100644
--- a/query-machine-capabilities/Makefile
+++ b/query-machine-capabilities/Makefile
@@ -1,6 +1,7 @@
 DESTDIR=
 PREFIX=/usr
 BINDIR=${PREFIX}/libexec/qemu-server
+SERVICEDIR=/lib/systemd/system
 
 CC ?= gcc
 CFLAGS += -O2 -fanalyzer -Werror -Wall -Wextra -Wpedantic -Wtype-limits -Wl,-z,relro -std=gnu11
@@ -12,6 +13,7 @@ query-machine-capabilities: query-machine-capabilities.c
 install: query-machine-capabilities
 	install -d ${DESTDIR}/${BINDIR}
 	install -m 0755 query-machine-capabilities ${DESTDIR}${BINDIR}
+	install -m 0644 query-machine-capabilities.service ${DESTDIR}${SERVICEDIR}
 
 .PHONY: clean
 clean:
diff --git a/query-machine-capabilities/query-machine-capabilities.service b/query-machine-capabilities/query-machine-capabilities.service
new file mode 100644
index 00000000..d9830a9d
--- /dev/null
+++ b/query-machine-capabilities/query-machine-capabilities.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=PVE Query Machine Capabilities
+RequiresMountsFor=/run
+Before=pve-ha-lrm.service
+Before=pve-guests.service
+
+[Service]
+ExecStart=/usr/libexec/qemu-server/query-machine-capabilities
+Type=oneshot
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
-- 
2.39.5



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