Skip to content

Commit

Permalink
Report when in-vm kernel supports memory hotplug
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarek committed Apr 20, 2024
1 parent 3abad67 commit 07a5c7b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions qubes-rpc/post-install.d/10-qubes-core-agent-memory-hotplug.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

# detect if in-vm kernel supports memory hotplug
# report for newest kernel in /boot, regardless of which one is running

shopt -s nullglob

mem_hotplug_supported=
# look for first kernel with matching config
for kernel in $(ls /boot/vmlinuz-* | sort -rV); do
kver="${kernel#*/vmlinuz-}"
if [ -e "/boot/config-$kver" ]; then
config="/boot/config-$kver"
if grep -q CONFIG_XEN_BALLOON_MEMORY_HOTPLUG=y "$config"; then
mem_hotplug_supported=1
fi
break
fi
done

# report both positive and negative info
qvm-features-request supported-feature.memory-hotplug="$mem_hotplug_supported"

0 comments on commit 07a5c7b

Please sign in to comment.