Bug #6377
closedIncorrect dhcp providers server virsh.rb loadSubnetData
Description
The commit fixes dhcp server virsh.rb provider. Upon loading the
contents of the libvirt network XML and parsing for DHCP reservations a
check is performed on the kind of records that are being loaded. The
dhcp_api.rb 'delete' helper tries to load network entries of the
'reservation' kind, the helper uses modules/dhcp/dhcp/subnet.rb to
validate on that and filter out entries.
In contrary to other providers (ms, isc) the loadSubnetData method of
virsh.rb was dealing out "Proxy::DHCP::Record" for any entry it was able
to discover, but should have been instantiating
"Proxy::DHCP::Reservation" to pass the validation.
This resulted in "ERROR -- : Record
x.x.x.x/xx:xx:xx:xx:xx:xx not found" as well as leaves in the libvirt
network XML. This prevented the creation of VMs with the same addresses,
since leftover DHCP entries conflicted with the new ones.