93e9d7301e
Most code which directly accesses nd_table[] and nb_nics uses them for one of two things. Either "I have created a NIC device and I'd like a configuration for it", or "I will create a NIC device *if* there is a configuration for it". With some variants on the theme around whether they actually *check* if the model specified in the configuration is the right one. Provide functions which perform both of those, allowing platforms to be a little more consistent and as a step towards making nd_table[] and nb_nics private to the net code. One might argue that platforms ought to be consistent about whether they create the unconfigured devices or not, but making significant user-visible changes is explicitly *not* the intent right now. The new functions leave the 'model' field of the NICInfo as NULL after using it for the default NIC model, unlike the qemu_check_nic_model() function which does set nd->model to match default_model explicitly. This is acceptable because there is no code which consumes nd->model except this NIC-matching code in net/net.c, and no reasonable excuse for any code wanting to use nd->model in future. Also export the qemu_find_nic_info() helper, as some platforms have special cases they need to handle. Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Reviewed-by: Paul Durrant <paul@xen.org> Reviewed-by: Thomas Huth <thuth@redhat.com> |
||
---|---|---|
.. | ||
can | ||
af-xdp.c | ||
announce.c | ||
checksum.c | ||
clients.h | ||
colo-compare.c | ||
colo-compare.h | ||
colo.c | ||
colo.h | ||
dgram.c | ||
dump.c | ||
eth.c | ||
filter-buffer.c | ||
filter-mirror.c | ||
filter-replay.c | ||
filter-rewriter.c | ||
filter.c | ||
hub.c | ||
hub.h | ||
l2tpv3.c | ||
meson.build | ||
net-hmp-cmds.c | ||
net.c | ||
netmap.c | ||
queue.c | ||
slirp.c | ||
socket.c | ||
stream.c | ||
tap_int.h | ||
tap-bsd.c | ||
tap-linux.c | ||
tap-linux.h | ||
tap-solaris.c | ||
tap-stub.c | ||
tap-win32.c | ||
tap.c | ||
trace-events | ||
trace.h | ||
util.c | ||
util.h | ||
vde.c | ||
vhost-user-stub.c | ||
vhost-user.c | ||
vhost-vdpa-stub.c | ||
vhost-vdpa.c | ||
vmnet_int.h | ||
vmnet-bridged.m | ||
vmnet-common.m | ||
vmnet-host.c | ||
vmnet-shared.c |