diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-01-08 15:21:22 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-01-21 18:00:26 -0500 |
| commit | c6ecbdd86edaacf8e1dbcc645333563dd2d2c8b1 (patch) | |
| tree | 69477d37c2637538b564950582f077acf71e8413 /recipes-containers/vcontainer/files | |
| parent | 264dee332be8e44392388e2baa40a1bfe3735b81 (diff) | |
| download | meta-virtualization-c6ecbdd86edaacf8e1dbcc645333563dd2d2c8b1.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')
| -rwxr-xr-x | recipes-containers/vcontainer/files/vcontainer-common.sh | 4 |
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 |
