]> git.proxmox.com Git - mirror_qemu.git/commit
net/vhost-user: Fix device compatibility check
authorKevin Wolf <kwolf@redhat.com>
Fri, 8 Oct 2021 13:34:29 +0000 (15:34 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 15 Oct 2021 14:05:46 +0000 (16:05 +0200)
commit5c485d51c4e2e8b3c78110a1a3f31f789c900d9d
tree63609926c4a9c65b23ca22238cae0abd70d88286
parente287bf7bb15ffd3728c000d9c5b52460ea17d713
net/vhost-user: Fix device compatibility check

vhost-user works only with specific devices. At startup, it second
guesses what the command line option handling will do and error out if
it thinks a non-virtio device will attach to them.

This second guessing is not only ugly, it can lead to wrong error
messages ('-device floppy,netdev=foo' should complain about an unknown
property, not about the wrong kind of network device being attached) and
completely ignores hotplugging.

Drop the old checks and implement .check_peer_type() instead to fix
this. As a nice side effect, it also removes one more dependency on the
legacy QemuOpts infrastructure and even reduces the code size.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20211008133442.141332-3-kwolf@redhat.com>
Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
net/vhost-user.c