From 936016b96d195eb07e730f90caa1084e62edd208 Mon Sep 17 00:00:00 2001 Message-ID: <936016b96d195eb07e730f90caa1084e62edd208.1764872379.git.phrdina@redhat.com> From: Pavel Hrdina Date: Fri, 21 Nov 2025 10:11:34 +0100 Subject: [PATCH] virtinst: interface: add support for backend.hostname and backend.fqdn From: Pavel Hrdina Signed-off-by: Pavel Hrdina (cherry picked from commit d57e2e738f37444a48c1e762ee63114583d6348f) Resolves: https://issues.redhat.com/browse/RHEL-95370 Signed-off-by: Pavel Hrdina --- tests/data/cli/compare/virt-install-many-devices.xml | 5 +++++ tests/test_cli.py | 1 + virtinst/cli.py | 2 ++ virtinst/devices/interface.py | 2 ++ 4 files changed, 10 insertions(+) diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml index 9b8b3c6ba..5edca096d 100644 --- a/tests/data/cli/compare/virt-install-many-devices.xml +++ b/tests/data/cli/compare/virt-install-many-devices.xml @@ -680,6 +680,11 @@ + + + + + diff --git a/tests/test_cli.py b/tests/test_cli.py index daf6e2a80..90f6ab983 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -675,6 +675,7 @@ source.reservations.managed=no,source.reservations.source.type=unix,source.reser --network passt,portForward=8080 --network passt,portForward0=7000-8000/udp,portForward1=127.0.0.1:2222:22 --network passt,portForward0=2001:db8:ac10:fd01::1:10:3000-4000:30,portForward1=127.0.0.1:5000-6000:5 +--network passt,backend.hostname=test,backend.fqdn=test.example.com --network type=hostdev,source.address.type=pci,source.address.domain=0x0,source.address.bus=0x00,source.address.slot=0x07,source.address.function=0x0 --network hostdev=pci_0000_00_09_0 --network hostdev=0:0:4.0 diff --git a/virtinst/cli.py b/virtinst/cli.py index 1203b0c8d..ed97e8809 100644 --- a/virtinst/cli.py +++ b/virtinst/cli.py @@ -4272,6 +4272,8 @@ class ParserNetwork(VirtCLIParser): # Standard XML options cls.add_arg("type", "type", cb=cls.set_type_cb) cls.add_arg("backend.type", "backend.type") + cls.add_arg("backend.hostname", "backend.hostname") + cls.add_arg("backend.fqdn", "backend.fqdn") cls.add_arg("backend.logFile", "backend.logFile") cls.add_arg("trustGuestRxFilters", "trustGuestRxFilters", is_onoff=True) diff --git a/virtinst/devices/interface.py b/virtinst/devices/interface.py index 333b92eca..9d82ab586 100644 --- a/virtinst/devices/interface.py +++ b/virtinst/devices/interface.py @@ -132,6 +132,8 @@ class _Backend(XMLBuilder): XML_NAME = "backend" type = XMLProperty("./@type") + hostname = XMLProperty("./@hostname") + fqdn = XMLProperty("./@fqdn") logFile = XMLProperty("./@logFile", do_abspath=True) -- 2.52.0