Files
qemu/rpm/qemu-supportconfig
Jim Fehlig 073249aca9 [openSUSE] supportconfig: Adapt plugin to modern supportconfig
The supportconfig 'scplugin.rc' file is deprecated in favor of
supportconfig.rc'. Adapt the qemu plugin to the new scheme.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
2025-04-01 17:58:55 +02:00

54 lines
1.6 KiB
Bash

#!/bin/bash
#############################################################
# Name: Supportconfig Plugin for QEMU/KVM
# Description: Gathers important troubleshooting information
# about QEMU
#############################################################
RCFILE="/usr/lib/supportconfig/resources/supportconfig.rc"
OF="output-qemu.txt"
if [ -s $RCFILE ]; then
if ! source $RCFILE; then
log_write $OF "ERROR: Initializing resource file: $RCFILE"
exit 1
fi
fi
rpm_verify $OF qemu || exit 111
# skip if the host is xen
log_write $OF "#==[ Checking if booted Xen ]=================================#"
if [ -d /proc/xen ] && [ -e /proc/xen/capabilities ] && [ `cat /proc/xen/capabilities` = "control_d" ]; then
log_write $OF "Yes"
log_write $OF "Skipped"
exit 0
else
log_write $OF "No"
fi
# basic system information
log_cmd $OF "uname -r"
log_cmd $OF "lscpu"
log_cmd $OF "lspci -v"
log_cmd $OF "lsscsi"
log_cmd $OF "kvm_stat -1"
log_cmd $OF "lsmod | grep ^kvm"
for MODULE in `lsmod | grep ^kvm | cut -d ' ' -f 1`; do
log_cmd $OF "modinfo $MODULE"
done
log_cmd $OF "ps -ef | grep qemu"
# list contents of common config and image directories
log_cmd $OF "ls -alR /var/lib/libvirt/images/"
# network-related info often useful for debugging
nm_enabled=$(systemctl is-enabled NetworkManager.service > /dev/null 2>&1; echo $?)
if [ $nm_enabled -eq 0 ]; then
log_write $OF "NOTE: NetworkManager should not be enabled on a KVM host"
fi
log_cmd $OF "ip route list"
log_cmd $OF "ip neigh list"
log_cmd $OF "ip link show type bridge"
log_cmd $OF "bridge link show"