Skip to content

Commit 2194c2e

Browse files
dcuiSasha Levin
authored andcommitted
hv_sock: Add the support of hibernation
Add the necessary dummy callbacks for hibernation. Signed-off-by: Dexuan Cui <[email protected]> Acked-by: David S. Miller <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 1ecf302 commit 2194c2e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

net/vmw_vsock/hyperv_transport.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,24 @@ static int hvs_remove(struct hv_device *hdev)
938938
return 0;
939939
}
940940

941+
/* hv_sock connections can not persist across hibernation, and all the hv_sock
942+
* channels are forced to be rescinded before hibernation: see
943+
* vmbus_bus_suspend(). Here the dummy hvs_suspend() and hvs_resume()
944+
* are only needed because hibernation requires that every vmbus device's
945+
* driver should have a .suspend and .resume callback: see vmbus_suspend().
946+
*/
947+
static int hvs_suspend(struct hv_device *hv_dev)
948+
{
949+
/* Dummy */
950+
return 0;
951+
}
952+
953+
static int hvs_resume(struct hv_device *dev)
954+
{
955+
/* Dummy */
956+
return 0;
957+
}
958+
941959
/* This isn't really used. See vmbus_match() and vmbus_probe() */
942960
static const struct hv_vmbus_device_id id_table[] = {
943961
{},
@@ -949,6 +967,8 @@ static struct hv_driver hvs_drv = {
949967
.id_table = id_table,
950968
.probe = hvs_probe,
951969
.remove = hvs_remove,
970+
.suspend = hvs_suspend,
971+
.resume = hvs_resume,
952972
};
953973

954974
static int __init hvs_init(void)

0 commit comments

Comments
 (0)