virtio-net: Don't print the compat warning for the default device

Compat messages are there to print a warning when the user creates a virtio
device for the VM, but the guest doesn't initialize it.

This generally works great, except that kvmtool will always create a
virtio-net device, even if the user hasn't specified one, which means that
each time kvmtool loads a guest that doesn't probe the network interface,
the user will get the compat warning. This can get particularly annoying
when running kvm-unit-tests, which doesn't need to use a network interface,
and the virtio-net warning is displayed after each test.

Let's fix this by skipping the compat message in the case of the
automatically created virtio-net device. This lets kvmtool keep the compat
warnings as they are, but removes the false positive.

Even if the user is relying on kvmtool creating the default virtio-net
device, a missing network interface in the guest is very easy to
discover.

Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
Link: https://lore.kernel.org/r/20230714152909.31723-1-alexandru.elisei@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
1 file changed