]> git.ipfire.org Git - thirdparty/libvirt.git/commit
network: restrict usage of port management APIs
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 26 Jul 2018 10:37:32 +0000 (11:37 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 16 Apr 2019 13:44:53 +0000 (14:44 +0100)
commitdd52444f231c205fb624fdeb59145722ba887aaa
treeec88d2e695232ea7c88b520aa6082979667fa2ea
parent545b0574fd27b56f243e21711935f99160cec214
network: restrict usage of port management APIs

The port allocation APIs are currently called unconditionally for all
types of NIC, but (mostly) only do anything for NICs with type=network.

The exception is the port allocate API which does some validation even
for NICs with type!=network. Relying on this validation is flawed,
however, since the network driver may not even be installed. IOW virt
drivers must not delegate validation to the network driver for NICs
with type != network.

This change allows us to report errors when the virtual network driver
is not registered.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/conf/domain_conf.c
src/libxl/libxl_domain.c
src/libxl/libxl_driver.c
src/lxc/lxc_driver.c
src/lxc/lxc_process.c
src/network/bridge_driver.c
src/qemu/qemu_driver.c
src/qemu/qemu_hotplug.c
src/qemu/qemu_process.c