svn commit: r352925 - head/sys/dev/xen/control

Ravi Pokala rpokala at freebsd.org
Wed Oct 2 01:42:24 UTC 2019


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 string. Is that what we want?

Thanks,

Ravi (rpokala@)

-----Original Message-----
From: <owner-src-committers at freebsd.org> on behalf of Roger Pau Monné <royger at FreeBSD.org>
Date: 2019-10-01, Tuesday at 01:21
To: <src-committers at freebsd.org>, <svn-src-all at freebsd.org>, <svn-src-head at freebsd.org>
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
    
    Log:
      xen/ctrl: acknowledge all control requests
      
      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.
      
      Fix this by acknowledging all requests, and remove the suspend specific
      ack done in the handler.
      
      Sponsored by:	Citrix Systems R&D
      MFC after:	3 days
    
    Modified:
      head/sys/dev/xen/control/control.c
    
    Modified: head/sys/dev/xen/control/control.c
    ==============================================================================
    --- head/sys/dev/xen/control/control.c	Tue Oct  1 03:35:54 2019	(r352924)
    +++ head/sys/dev/xen/control/control.c	Tue Oct  1 08:21:41 2019	(r352925)
    @@ -221,12 +221,6 @@ xctrl_suspend()
     	KASSERT((PCPU_GET(cpuid) == 0), ("Not running on CPU#0"));
     
     	/*
    -	 * 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-MPSAFE
     	 * drivers need this.
     	 */
    @@ -368,6 +362,11 @@ xctrl_on_watch_event(struct xs_watch *watch, const cha
     			&result_len, (void **)&result);
     	if (error != 0)
     		return;
    +
    +	/* Acknowledge the request by writing back an empty string. */
    +	error = xs_write(XST_NIL, "control", "shutdown", "");
    +	if (error != 0)
    +		printf("unable to ack shutdown request, proceeding anyway\n");
     
     	reason = xctrl_shutdown_reasons;
     	last_reason = reason + nitems(xctrl_shutdown_reasons);
    




More information about the svn-src-head mailing list