From owner-svn-src-all@freebsd.org Wed Oct 2 01:42:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C4F4FDEBD; Wed, 2 Oct 2019 01:42:24 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jf5X1Tl4z4ddk; Wed, 2 Oct 2019 01:42:24 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [172.17.133.228] (unknown [12.202.168.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 7423A61AA; Wed, 2 Oct 2019 01:42:23 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.1d.0.190908 Date: Tue, 01 Oct 2019 18:42:14 -0700 Subject: Re: svn commit: r352925 - head/sys/dev/xen/control From: Ravi Pokala To: Roger Pau =?UTF-8?B?TW9ubsOp?= , , , Message-ID: <5E0C7E54-2657-4E70-8A18-84C4EE29D4FA@panasas.com> Thread-Topic: svn commit: r352925 - head/sys/dev/xen/control References: <201910010821.x918LfOg005983@repo.freebsd.org> In-Reply-To: <201910010821.x918LfOg005983@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2019 01:42:24 -0000 Hi Roger, If I'm understanding this diff correctly, all of (poweroff, reboot, suspend= ) will use the common string "shutdown", rather than an event-specific strin= g. Is that what we want? Thanks, Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: on behalf of Roger Pau Monn=C3=A9 Date: 2019-10-01, Tuesday at 01:21 To: , , Subject: svn commit: r352925 - head/sys/dev/xen/control Author: royger Date: Tue Oct 1 08:21:41 2019 New Revision: 352925 URL: https://svnweb.freebsd.org/changeset/base/352925 =20 Log: xen/ctrl: acknowledge all control requests =20 Currently only suspend requests are acknowledged by writing an empty string back to the xenstore control node, but poweroff or reboot requests are not acknowledged and FreeBSD simply proceeds to perform the desired action. =20 Fix this by acknowledging all requests, and remove the suspend specif= ic ack done in the handler. =20 Sponsored by: Citrix Systems R&D MFC after: 3 days =20 Modified: head/sys/dev/xen/control/control.c =20 Modified: head/sys/dev/xen/control/control.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/dev/xen/control/control.c Tue Oct 1 03:35:54 2019 (r35292= 4) +++ head/sys/dev/xen/control/control.c Tue Oct 1 08:21:41 2019 (r35292= 5) @@ -221,12 +221,6 @@ xctrl_suspend() KASSERT((PCPU_GET(cpuid) =3D=3D 0), ("Not running on CPU#0")); =20 /* - * Clear our XenStore node so the toolstack knows we are - * responding to the suspend request. - */ - xs_write(XST_NIL, "control", "shutdown", ""); - - /* * Be sure to hold Giant across DEVICE_SUSPEND/RESUME since non-MPSAF= E * drivers need this. */ @@ -368,6 +362,11 @@ xctrl_on_watch_event(struct xs_watch *watch, const= cha &result_len, (void **)&result); if (error !=3D 0) return; + + /* Acknowledge the request by writing back an empty string. */ + error =3D xs_write(XST_NIL, "control", "shutdown", ""); + if (error !=3D 0) + printf("unable to ack shutdown request, proceeding anyway\n"); =20 reason =3D xctrl_shutdown_reasons; last_reason =3D reason + nitems(xctrl_shutdown_reasons); =20