Description of problem: Parameter 'network' is used in NetworkPort.pm, but Network.pm get_port_by_uuid() and create_port() pass 'net' to NetworkPort.pm by mistake. Version-Release number of selected component (if applicable): perl-Sys-Virt-5.6.0-1.module+el8.1.0+3908+8a8c5ed4.x86_64 How reproducible: 100% Steps to Reproduce: 1. # cat lib/Sys/Virt/Network.pm sub create_port { my $self = shift; my $xml = shift; my $flags = shift || 0; return Sys::Virt::NetworkPort->_new(net => $self, xml => $xml, flags => $flags); } =item $port = $net->get_port_by_uuid($uuid); ... =cut sub get_port_by_uuid { my $self = shift; my $uuid = shift; return Sys::Virt::NetworkPort->_new(net => $self, uuid => $uuid); } # cat lib/Sys/Virt/NetworkPort.pm sub _new { my $proto = shift; my $class = ref($proto) || $proto; my %params = @_; my $net = exists $params{network} ? $params{network} : die "network parameter is required"; my $self; ... } 2. 3. Actual results: Expected results: Additional info:
Fixed upstream in commit 5c1d7aa2ad4817f8705da9ba0216fc4f59fd939f Author: Daniel P. Berrangé <berrange> Date: Mon Sep 2 10:23:12 2019 +0100 Fix Sys::Virt::NetworkPort creation Signed-off-by: Daniel P. Berrangé <berrange>
Package: perl-Sys-Virt-5.6.0-2.module+el8.1.0+4140+e3893fe6.x86_64 Check source code and patch files. Verified
# libvirt-tck --testdir 141-net-port.t -v --force 141-net-port.t .. 1..18 Downloading RHEL disk Convert the RHEL image to raw format # Running the first boot # Add two controllers for hotplugging # Creating a new transient domain ok 1 - created permanent domain object # Creating a new transient network ok 2 - created transient network object # Attaching the new interface 00:11:22:33:44:66 to guest ok 3 - interface has been attached to guest # Retrieve network port of new created network net-active ok 4 - Get 1 network port ok 5 - The network port is deleted ok 6 - Get 0 network port ok 7 - Get correct port by uuid ok 8 - Get correct port uuid string 22222222-2222-2222-2222-222222222222 # <networkport> # <uuid>22222222-2222-2222-2222-222222222222</uuid> # <owner> # <name>tck</name> # <uuid>231bfc0d-aeb4-41a2-afb6-f29bda580b69</uuid> # </owner> # <mac address='00:11:22:33:44:66'/> # <bandwidth> # <inbound average='500' peak='2000' floor='200' burst='2560'/> # <outbound average='128' peak='256' burst='256'/> # </bandwidth> # <plug type='network' bridge='virbr1'/> # </networkport> ok 9 - Get port xml description ok 10 - Get correct bandwidth inbound average 500 ok 11 - Get correct bandwidth inbound burst 2560 ok 12 - Get correct bandwidth inbound peak 2000 ok 13 - Get correct bandwidth inbound floor 200 ok 14 - Get correct bandwidth outbound average 128 ok 15 - Get correct bandwidth outbound average 256 ok 16 - Get correct bandwidth outbound average 256 # Detaching the new interface 00:11:22:33:44:66 ok 17 - interface has been detached # Destroy net-active network ok 18 - network net-active has been destoryed ok All tests successful. Files=1, Tests=18, 69 wallclock secs ( 0.02 usr 0.00 sys + 5.55 cusr 2.28 csys = 7.85 CPU) Result: PASS
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:3723