On 2/24/26 08:52, Laine Stump via Devel wrote:
From: Laine Stump <laine@redhat.com>
libvirt's <interface> element has for a long time supported adding <route> sub-elements to specify arbitrary routes to be added to the guest OS networking, but historically this has only worked for LXC guests. If you tried to add <route> to the interface of a QEMU guest, it would be rejected.
passt networking doesn't support setting *any arbitrary* route but it does support setting a default route (using the passt commandline "--gateway" parameter). A default route is really just a "route with unspecified destination/prefix", so a default route can be specified in libvirt XML with:
<route gateway='192.168.0.1'/>
Attempts to give a specified destination, prefix, or metric will result in a validation error.
Resolves: https://issues.redhat.com/browse/RHEL-46602 Signed-off-by: Laine Stump <laine@redhat.com> --- src/qemu/qemu_passt.c | 16 +++++++++++++ src/qemu/qemu_validate.c | 50 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 62 insertions(+), 4 deletions(-)
Please, squash in the following: diff --git i/tests/qemuxmlconfdata/net-user-passt.x86_64-7.2.0.passt0.args w/tests/qemuxmlconfdata/net-user-passt.x86_64-7.2.0.passt0.args index b0f26d8089..182d8ae054 100644 --- i/tests/qemuxmlconfdata/net-user-passt.x86_64-7.2.0.passt0.args +++ w/tests/qemuxmlconfdata/net-user-passt.x86_64-7.2.0.passt0.args @@ -9,6 +9,7 @@ passt \ --address 172.17.2.0 \ --netmask 24 \ --address 2001:db8:ac10:fd01::feed \ +--gateway 192.168.0.1 \ --tcp-ports '2001:db8:ac10:fd01::1:10/22:2022,1000-1050,~1020,~1030-1040' \ --udp-ports '1.2.3.4%eth0/5000-5020:6000-6020,~5010-5015' \ --tcp-ports 80 \ diff --git i/tests/qemuxmlconfdata/net-user-passt.x86_64-7.2.0.xml w/tests/qemuxmlconfdata/net-user-passt.x86_64-7.2.0.xml index 77da297936..ecad9a40b5 100644 --- i/tests/qemuxmlconfdata/net-user-passt.x86_64-7.2.0.xml +++ w/tests/qemuxmlconfdata/net-user-passt.x86_64-7.2.0.xml @@ -33,6 +33,7 @@ <source dev='eth42'/> <ip address='172.17.2.0' family='ipv4' prefix='24'/> <ip address='2001:db8:ac10:fd01::feed' family='ipv6'/> + <route gateway='192.168.0.1'/> <portForward proto='tcp' address='2001:db8:ac10:fd01::1:10'> <range start='22' to='2022'/> <range start='1000' end='1050'/> diff --git i/tests/qemuxmlconfdata/net-user-passt.x86_64-latest.passt0.args w/tests/qemuxmlconfdata/net-user-passt.x86_64-latest.passt0.args index b0f26d8089..182d8ae054 100644 --- i/tests/qemuxmlconfdata/net-user-passt.x86_64-latest.passt0.args +++ w/tests/qemuxmlconfdata/net-user-passt.x86_64-latest.passt0.args @@ -9,6 +9,7 @@ passt \ --address 172.17.2.0 \ --netmask 24 \ --address 2001:db8:ac10:fd01::feed \ +--gateway 192.168.0.1 \ --tcp-ports '2001:db8:ac10:fd01::1:10/22:2022,1000-1050,~1020,~1030-1040' \ --udp-ports '1.2.3.4%eth0/5000-5020:6000-6020,~5010-5015' \ --tcp-ports 80 \ diff --git i/tests/qemuxmlconfdata/net-user-passt.x86_64-latest.xml w/tests/qemuxmlconfdata/net-user-passt.x86_64-latest.xml index 917a9edaa0..fc5a5e37aa 100644 --- i/tests/qemuxmlconfdata/net-user-passt.x86_64-latest.xml +++ w/tests/qemuxmlconfdata/net-user-passt.x86_64-latest.xml @@ -33,6 +33,7 @@ <source dev='eth42'/> <ip address='172.17.2.0' family='ipv4' prefix='24'/> <ip address='2001:db8:ac10:fd01::feed' family='ipv6'/> + <route gateway='192.168.0.1'/> <portForward proto='tcp' address='2001:db8:ac10:fd01::1:10'> <range start='22' to='2022'/> <range start='1000' end='1050'/> diff --git i/tests/qemuxmlconfdata/net-user-passt.xml w/tests/qemuxmlconfdata/net-user-passt.xml index 80d15de2ed..3edad133aa 100644 --- i/tests/qemuxmlconfdata/net-user-passt.xml +++ w/tests/qemuxmlconfdata/net-user-passt.xml @@ -30,6 +30,7 @@ <source dev='eth42'/> <ip address='172.17.2.0' family='ipv4' prefix='24'/> <ip address='2001:db8:ac10:fd01::feed' family='ipv6'/> + <route gateway='192.168.0.1'/> <portForward proto='tcp' address='2001:db8:ac10:fd01::1:10'> <range start='22' to='2022'/> <range start='1000' end='1050'/> Michal