From 1262c07900b8a67ef186d6f3a9eeb52a3d71c376 Mon Sep 17 00:00:00 2001 From: GnomeZworc Date: Fri, 16 May 2025 15:30:00 +0200 Subject: [PATCH] fix error in stop metadata Signed-off-by: GnomeZworc --- lib/qemu.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/qemu.sh b/lib/qemu.sh index 92846d7..a452198 100644 --- a/lib/qemu.sh +++ b/lib/qemu.sh @@ -77,6 +77,7 @@ function qemu_stop_vm { local ip="$(echo "${vm_def}" | cut -d\; -f 5)" local subnet_def=$(get_from_db "subnet" "${subnet_name}") local vpc_name="$(echo "${subnet_def}" | cut -d\; -f 2)" + local gateway_ip="$(echo "${subnet_def}" | cut -d\; -f 5 | cut -d\/ -f 1)" local unix_path="/tmp/${vm_name}.qmp-sock" @@ -88,7 +89,7 @@ function qemu_stop_vm { print_in_color "${COLOR_RED}" "Delete tap${tap_id}" ip -n "${vpc_name}" link del dev "tap${tap_id}" - metadata_stop "${vpc_name}" "${ip}" "${metadata_port}" + metadata_stop "${vpc_name}" "${gateway_ip}" "${metadata_port}" delete_in_db "vm" "${vm_name}" print_in_color "${COLOR_GREY}" "Try to delete ${subnet_name}"