vsock/vmci: register vmci_transport only when VMCI guest/host are active
authorStefano Garzarella <sgarzare@redhat.com>
Thu, 14 Nov 2019 09:57:47 +0000 (10:57 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Nov 2019 02:12:18 +0000 (18:12 -0800)
commitb1bba80a4376aef34de2b57bfb8834bd095703ed
treeb22280bc8b8e0f8789bfeb7f4013e0c670be2ca4
parentc0cfa2d8a788fcf45df5bf4070ab2474c88d543a
vsock/vmci: register vmci_transport only when VMCI guest/host are active

To allow other transports to be loaded with vmci_transport,
we register the vmci_transport as G2H or H2G only when a VMCI guest
or host is active.

To do that, this patch adds a callback registered in the vmci driver
that will be called when the host or guest becomes active.
This callback will register the vmci_transport in the VSOCK core.

Cc: Jorgen Hansen <jhansen@vmware.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/misc/vmw_vmci/vmci_driver.c
drivers/misc/vmw_vmci/vmci_driver.h
drivers/misc/vmw_vmci/vmci_guest.c
drivers/misc/vmw_vmci/vmci_host.c
include/linux/vmw_vmci_api.h
net/vmw_vsock/vmci_transport.c