summaryrefslogtreecommitdiffstats
path: root/recipes-containers/vcontainer/files/vcontainer-common.sh
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2026-01-08 15:21:22 +0000
committerBruce Ashfield <bruce.ashfield@gmail.com>2026-02-09 03:32:52 +0000
commit3c01c9aaa14b5385cbdb176a4c721ecc8fa45088 (patch)
treea00863dcc7f562c912500284ecfe168761e68fa4 /recipes-containers/vcontainer/files/vcontainer-common.sh
parent6cd8f5c67a439bb2ca05da2b608a77c1622ea38c (diff)
downloadmeta-virtualization-3c01c9aaa14b5385cbdb176a4c721ecc8fa45088.tar.gz
vcontainer-common: fix QMP netdev ID for hostfwd commands
The QEMU netdev is named 'net0', not 'user.0'. Fix the hostfwd_add and hostfwd_remove commands to use the correct netdev ID. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/vcontainer/files/vcontainer-common.sh')
-rwxr-xr-xrecipes-containers/vcontainer/files/vcontainer-common.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/recipes-containers/vcontainer/files/vcontainer-common.sh b/recipes-containers/vcontainer/files/vcontainer-common.sh
index 3e8489aa..7f177e63 100755
--- a/recipes-containers/vcontainer/files/vcontainer-common.sh
+++ b/recipes-containers/vcontainer/files/vcontainer-common.sh
@@ -743,7 +743,7 @@ qmp_add_hostfwd() {
743 743
744 [ "$VERBOSE" = "true" ] && echo -e "${CYAN}[$VCONTAINER_RUNTIME_NAME]${NC} Adding port forward: ${host_port} -> ${guest_port}/${protocol}" >&2 744 [ "$VERBOSE" = "true" ] && echo -e "${CYAN}[$VCONTAINER_RUNTIME_NAME]${NC} Adding port forward: ${host_port} -> ${guest_port}/${protocol}" >&2
745 745
746 local result=$(qmp_send "hostfwd_add user.0 ${protocol}::${host_port}-:${guest_port}") 746 local result=$(qmp_send "hostfwd_add net0 ${protocol}::${host_port}-:${guest_port}")
747 if echo "$result" | grep -q '"error"'; then 747 if echo "$result" | grep -q '"error"'; then
748 echo -e "${RED}[$VCONTAINER_RUNTIME_NAME]${NC} Failed to add port forward: $result" >&2 748 echo -e "${RED}[$VCONTAINER_RUNTIME_NAME]${NC} Failed to add port forward: $result" >&2
749 return 1 749 return 1
@@ -759,7 +759,7 @@ qmp_remove_hostfwd() {
759 759
760 [ "$VERBOSE" = "true" ] && echo -e "${CYAN}[$VCONTAINER_RUNTIME_NAME]${NC} Removing port forward: ${host_port}/${protocol}" >&2 760 [ "$VERBOSE" = "true" ] && echo -e "${CYAN}[$VCONTAINER_RUNTIME_NAME]${NC} Removing port forward: ${host_port}/${protocol}" >&2
761 761
762 local result=$(qmp_send "hostfwd_remove user.0 ${protocol}::${host_port}") 762 local result=$(qmp_send "hostfwd_remove net0 ${protocol}::${host_port}")
763 if echo "$result" | grep -q '"error"'; then 763 if echo "$result" | grep -q '"error"'; then
764 echo -e "${RED}[$VCONTAINER_RUNTIME_NAME]${NC} Failed to remove port forward: $result" >&2 764 echo -e "${RED}[$VCONTAINER_RUNTIME_NAME]${NC} Failed to remove port forward: $result" >&2
765 return 1 765 return 1