RE: [PATCH v4 3/4] hv_utils: Support host-initiated hibernation request
From: Michael Kelley
Date: Sun Jan 26 2020 - 01:08:27 EST
From: Dexuan Cui <decui@xxxxxxxxxxxxx> Sent: Saturday, January 25, 2020 9:50 PM
>
> Update the Shutdown IC version to 3.2, which is required for the host to
> send the hibernation request.
>
> The user is expected to create the below udev rule file, which is applied
> upon the host-initiated hibernation request:
>
> root@localhost:~# cat /usr/lib/udev/rules.d/40-vm-hibernation.rules
> SUBSYSTEM=="vmbus", ACTION=="change", DRIVER=="hv_utils",
> ENV{EVENT}=="hibernate", RUN+="/usr/bin/systemctl hibernate"
>
> Signed-off-by: Dexuan Cui <decui@xxxxxxxxxxxxx>
>
> ---
> Changes in v2:
> Send the host-initiated hibernation request to the user space via udev.
> (v1 used call_usermodehelper() and "/sbin/hyperv-hibernate".)
>
> Changes in v3 (I addressed Michael's comoments):
> Fixed the order issue in sd_versions[].
> Moved schedule_work() to a later place for consistency.
>
> Changes in v4 (Thanks to Michael!):
> Used a compact way to handle the work item.
>
> drivers/hv/hv_util.c | 49 +++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 48 insertions(+), 1 deletion(-)
>
Reviewed-by: Michael Kelley <mikelley@xxxxxxxxxxxxx>