Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2578382ybe; Thu, 12 Sep 2019 11:33:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4o4HwaS9qF4Ljxn0paXJNfMdFeoAAmD+8aLt5pu1fMwAPPxkQQS6U3bn07X54aH1vHpi1 X-Received: by 2002:a50:ed89:: with SMTP id h9mr43484892edr.217.1568313213705; Thu, 12 Sep 2019 11:33:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568313213; cv=none; d=google.com; s=arc-20160816; b=K/tJi2jwnPWOgI2hwEjLJiiG6kukjamv17TIVNhviQz49OIBPFEmOKAPQUW9+4PzES cFkaynZKUOyJzjkAxrBWKWdmej+M36RINsIZrGO+aqKxp4ySc27CB0zO/kWYlZKjcPDH jKCE5BuUKIOk8FFM9r2B8UIC5tSELlH7b8jfWLuHgq1cgqw4GqOH1Ji5jfEWrdTEnekk I/Ad2hSpMA39+3Wm5flhNqlGBIY4yYq0JmKMIxvDk27mMv/3dCF3DH6VHYHlR4No8GNI xCjXomAi6vd+Wug9LW4ydJ+5VA3g5IwF0zQHbhRDMfgS6YFCCGwl9gUgz7HJ5plSjCO/ WcnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=qziAxNyAubhHTYBSD4yRsXHN9OiFD1ZQQkCUflFkono=; b=VwVnnzU4dNB+TrZiDWb7DTkJCak3VRyI7bfwTcFXkwd4FfzrlkDClnpyeam1XQCntB SI7mJBbMWqLDz1VUvDp5kLHShcClef8tK0dP4SsFcqB7MSPLhfqH3MWPnaYjZ1kRhkZs 8BWKSzEzvkyp+OsPpvuETTyt92NEfHl1wk7MScMThK44BTOtKHjE09UbD895J4AruVIS N+iUlEW4s7ZoRh77FEq0XJFsPtBtNffyuVVHHQSrzRpMvFNi7lJo+vU7usHNU6DT6Zzx BufAlejB1Guy/iFTqmM03q2mdByxGTzh0gw0cBr9ftSid4KbE6xc1KCQxyiK7Zni1Fcp RT6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h43si15978764ede.142.2019.09.12.11.33.09; Thu, 12 Sep 2019 11:33:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730462AbfILQ1A (ORCPT + 99 others); Thu, 12 Sep 2019 12:27:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22249 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728558AbfILQ1A (ORCPT ); Thu, 12 Sep 2019 12:27:00 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C57F811A07 for ; Thu, 12 Sep 2019 16:26:59 +0000 (UTC) Received: by mail-wr1-f70.google.com with SMTP id x1so12220904wrn.11 for ; Thu, 12 Sep 2019 09:26:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=qziAxNyAubhHTYBSD4yRsXHN9OiFD1ZQQkCUflFkono=; b=pIrsjjlj9xaHHWV8kpB+s7tvoJ9AqmehKjEe56m6mspkNydn8oZ9IY0IpAwpt+pNLN bWaCfBEqPe1r4VO9S+rPKM3UQFpiMyRiZ99VYN2X0+8591BFZAxjQ1sNWYZH298FfYPO gqtLe2UOwo7ORX4v7N022tUSbdw4XvrkS+50taUKy4jEFvDiAgpykhGeqP30zzCrae5e wRdcc1ZWcBvu0KqIErv6DPlLVtyXshCvy2Vb7vwp2lsBAJmA9PCg4DO0amsu+oYsPhMA mL8fX20V2KiEHxER/X20lK/sKTV3UFE5jQw+sXcfiEwgN+tws3zaZY98hoWOO0V0MWIS hVOQ== X-Gm-Message-State: APjAAAVJADIwBKRaaIKix8YHJmYAcS+M3XG5GvEFUNdQ5hLdxZ5AgKJ7 0GieZQ4BfUfsg7biZnExHQ1bTlB3IsJBZ8pD/YlecDC6wJgzoSKfjZ9/Aw/lOgJwbueIKCn8WSt s6RBaXEMLipOoTIIm4z/cu69v X-Received: by 2002:a5d:4ac5:: with SMTP id y5mr30494549wrs.179.1568305618362; Thu, 12 Sep 2019 09:26:58 -0700 (PDT) X-Received: by 2002:a5d:4ac5:: with SMTP id y5mr30494531wrs.179.1568305618131; Thu, 12 Sep 2019 09:26:58 -0700 (PDT) Received: from vitty.brq.redhat.com (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id n1sm30678076wrg.67.2019.09.12.09.26.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2019 09:26:57 -0700 (PDT) From: Vitaly Kuznetsov To: Dexuan Cui Cc: KY Srinivasan , Haiyang Zhang , Stephen Hemminger , "sashal\@kernel.org" , "linux-hyperv\@vger.kernel.org" , "linux-kernel\@vger.kernel.org" , Michael Kelley Subject: Re: [PATCH 2/3] hv_utils: Support host-initiated hibernation request In-Reply-To: <1568245130-70712-3-git-send-email-decui@microsoft.com> References: <1568245130-70712-1-git-send-email-decui@microsoft.com> <1568245130-70712-3-git-send-email-decui@microsoft.com> Date: Thu, 12 Sep 2019 18:26:56 +0200 Message-ID: <87a7b9cwfj.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dexuan Cui writes: > +static void perform_hibernation(struct work_struct *dummy) > +{ > + /* > + * The user is expected to create the program, which can be a simple > + * script containing two lines: > + * #!/bin/bash > + * echo disk > /sys/power/state 'systemctl hibernate' is what people do nowadays :-) > + */ > + static char hibernate_cmd[PATH_MAX] = "/sbin/hyperv-hibernate"; > + Let's not do that (I remember when we were triggering network restart from netvsc and it was a lot of pain). Receiving hybernation request from the host is similar to pushing power button on your desktop: an ACPI event is going to be generated and your userspace will somehow react to it. I see two options: 1) We try to hook up some existing userspace (udev?) 2) We write a new hyperv-daemon handling the request (with a config file instead of hardcoding please). -- Vitaly