]> xenbits.xensource.com Git - pvdrivers/win/xeniface.git/commitdiff
Log if Windows Update requires a reboot
authorOwen Smith <owen.smith@citrix.com>
Mon, 5 Jul 2021 12:59:51 +0000 (13:59 +0100)
committerPaul Durrant <pdurrant@amazon.com>
Mon, 12 Jul 2021 18:56:13 +0000 (19:56 +0100)
Output log line if Windows Update requires a reboot, as soon as a shutdown or
reboot has been requested, in addition to when the service shuts down. The
service shutdown will output its log line *after* the "Installing Windows
Updates" screen has completed during shutdown.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
src/xenagent/xenifacedevice.cpp
src/xenagent/xenifacedevice.h

index eea63e4cec8e938bf000b1ecdc1749b4240a6fe3..46b4b6f2143b47b35dee12fa95304b77f2efe95b 100644 (file)
@@ -291,6 +291,7 @@ bool CXenIfaceDeviceList::CheckShutdown()
     if (type == "poweroff") {
         device->StoreWrite("control/shutdown", "");
         m_agent->EventLog(EVENT_XENUSER_POWEROFF);
+        LogIfRebootPending();
 
         AcquireShutdownPrivilege();
 #pragma warning(suppress:28159) /* Consider using a design alternative... Rearchitect to avoid Reboot */
@@ -304,6 +305,7 @@ bool CXenIfaceDeviceList::CheckShutdown()
     } else if (type == "reboot") {
         device->StoreWrite("control/shutdown", "");
         m_agent->EventLog(EVENT_XENUSER_REBOOT);
+        LogIfRebootPending();
 
         AcquireShutdownPrivilege();
 #pragma warning(suppress:28159) /* Consider using a design alternative... Rearchitect to avoid Reboot */
index dcac685cc1f9f2b9fc301738adfcc7229ecba362..3b5e4737cd1098b5a31a499392ae5f25915404ac 100644 (file)
@@ -86,9 +86,9 @@ public:
     void CheckXenTime();
     void CheckSuspend();
     bool CheckSlateMode(std::string& mode);
+    void LogIfRebootPending();
 
 private:
-    void LogIfRebootPending();
     void StartShutdownWatch(CXenIfaceDevice* device);
     void StopShutdownWatch(CXenIfaceDevice* device);
     void StartSlateModeWatch(CXenIfaceDevice* device);