This commit is contained in:
2025-06-15 19:16:04 +02:00
parent 06786aed90
commit 7b859d274c
2 changed files with 427 additions and 41 deletions

View File

@@ -220,10 +220,15 @@ delete_single_vm() {
stop_vm_process "$VM_PID" "$vm_name"
else
# Try to find the process by name
local found_pid=$(pgrep -f "cloud-hypervisor.*$vm_name" 2>/dev/null || echo "")
if [ -n "$found_pid" ]; then
warn "Found VM process by name: $found_pid"
stop_vm_process "$found_pid" "$vm_name"
local found_pids=$(pgrep -f "cloud-hypervisor.*$vm_name" 2>/dev/null || echo "")
if [ -n "$found_pids" ]; then
warn "Found VM process(es) by name: $found_pids"
# Process each PID separately
echo "$found_pids" | while read -r pid; do
if [ -n "$pid" ]; then
stop_vm_process "$pid" "$vm_name"
fi
done
fi
fi