Commit Graph

7 Commits

Author SHA1 Message Date
Thomas Lamprecht
301cc2bfb0 add pve prefix to query-machine-capabilities.service
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-18 21:56:15 +01:00
Markus Frank
88abf3643e query-machine-capabilities: add systemd service file
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>
2024-11-18 21:26:39 +01:00
Thomas Lamprecht
35c93dde5b query-machine-capabilities: factor out preparing output directory
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-17 19:12:39 +01:00
Thomas Lamprecht
390e77d438 query-machine-capabilities: use macro for output paths and error helpers
This moves all error output to stderr while at it and fixes some bad
references to wrong paths in some error messages.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-17 19:12:04 +01:00
Thomas Lamprecht
99e54ad6c3 query-machine-capabilities: factor out querying the CPU
to make the code easier to read.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-17 19:12:04 +01:00
Thomas Lamprecht
bd62724fcd query-machine-capabilities: fix indentation
do not propagate that absolute mess of mixing tabs and spaces to new
programs that ain't perl and thus doesn't need to suffer.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-17 19:12:04 +01:00
Markus Frank
c9eee44b47 add C program to get hardware capabilities from CPUID
Implement a C program that extracts AMD SEV hardware information such
as reduced-phys-bios and cbitpos from CPUID, looks if SEV, SEV-ES &
SEV-SNP are enabled, and outputs these details as JSON to
/run/qemu-server/host-hw-capabilities.json

This program can also be used to read and save other hardware
information.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
Co-authored-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
2024-11-17 18:37:03 +01:00