summaryrefslogtreecommitdiff
path: root/net/vmw_vsock
diff options
context:
space:
mode:
authorDexuan Cui <decui@microsoft.com>2019-09-26 00:34:13 +0300
committerSasha Levin <sashal@kernel.org>2019-11-22 04:10:44 +0300
commit2194c2eb6717f2ea7dc793ad9cbf44d359a3f696 (patch)
treef9d9ad36b93663fcc01f32b4aeaaee7e3aac2894 /net/vmw_vsock
parent1ecf302021040194ae46cceefe33ab75577e356d (diff)
downloadlinux-2194c2eb6717f2ea7dc793ad9cbf44d359a3f696.tar.xz
hv_sock: Add the support of hibernation
Add the necessary dummy callbacks for hibernation. Signed-off-by: Dexuan Cui <decui@microsoft.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/vmw_vsock')
-rw-r--r--net/vmw_vsock/hyperv_transport.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
index c443db7af8d4..cd4a364b3950 100644
--- a/net/vmw_vsock/hyperv_transport.c
+++ b/net/vmw_vsock/hyperv_transport.c
@@ -938,6 +938,24 @@ static int hvs_remove(struct hv_device *hdev)
return 0;
}
+/* hv_sock connections can not persist across hibernation, and all the hv_sock
+ * channels are forced to be rescinded before hibernation: see
+ * vmbus_bus_suspend(). Here the dummy hvs_suspend() and hvs_resume()
+ * are only needed because hibernation requires that every vmbus device's
+ * driver should have a .suspend and .resume callback: see vmbus_suspend().
+ */
+static int hvs_suspend(struct hv_device *hv_dev)
+{
+ /* Dummy */
+ return 0;
+}
+
+static int hvs_resume(struct hv_device *dev)
+{
+ /* Dummy */
+ return 0;
+}
+
/* This isn't really used. See vmbus_match() and vmbus_probe() */
static const struct hv_vmbus_device_id id_table[] = {
{},
@@ -949,6 +967,8 @@ static struct hv_driver hvs_drv = {
.id_table = id_table,
.probe = hvs_probe,
.remove = hvs_remove,
+ .suspend = hvs_suspend,
+ .resume = hvs_resume,
};
static int __init hvs_init(void)