On 2/24/26 8:13 AM, Michal Prívozník via Devel wrote:
On 2/24/26 08:52, Laine Stump via Devel wrote:
From: Laine Stump <laine@redhat.com>
The Linux/libnl version of virNetDevIPRouteAdd() has always had code that would use "0.0.0.0" (or "::" for IPv6) for the route's destination address if none was specified, but 1) our validation code has always required it to be specified anyway, 2) the FreeBSD version of virnertDevIPRouteAdd() expected that it would be specified, and 3) virNetDevIPRouteFormat() also expected route->address to be valid. This patch fixes those 3 deficiencies, so that this XML now works:
<route gateway='1.2.3.4'/>
i.e. it is the same as:
<route address='0.0.0.0' prefix='0' gateway='1.2.3.4'/>
Signed-off-by: Laine Stump <laine@redhat.com> --- src/conf/networkcommon_conf.c | 74 ++++++++++++++---------------- src/conf/schemas/networkcommon.rng | 4 +- src/util/virnetdevip.c | 12 ++++- 3 files changed, 48 insertions(+), 42 deletions(-)
Either this patch or the next one should mention this in the docs:
https://libvirt.org/formatdomain.html#ip-configuration
Esp. the part about "This is used by the LXC driver."
Good point! Actually each of them needs a tweak to the docs - this one should point out that address is optional (and defaults to the "all" address for the given family if not specified), and the next should say that it's used for the QEMU driver with a passt-backed interface.
Michal