]> xenbits.xensource.com Git - people/pauldu/xeniface.git/commitdiff
Call OnDeviceRemoved callback(s) during DeviceList.Stop()
authorOwen Smith <owen.smith@citrix.com>
Thu, 19 Jul 2018 11:55:31 +0000 (12:55 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Thu, 19 Jul 2018 11:55:31 +0000 (12:55 +0100)
OnDeviceAdded is called for every pre-attached device during
DeviceList.Start(), the corresponding call to OnDeviceRemoved should be
called for each attached device during the DeviceList.Stop() call.
By calling the OnDeviceRemoved callback during the service stop, the
xenagent service can remove the "feature-[poweroff|reboot|s3|s4]" flags.

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

index b40b252aadeb169eadc0251f7d594c41b23f2c85..e0583f91bc544861d1601be3a535e7122924e368 100644 (file)
@@ -218,6 +218,8 @@ void CDeviceList::Stop()
     for (DeviceMap::iterator it = m_devs.begin();
             it != m_devs.end();
             ++it) {
+        if (m_impl)
+            m_impl->OnDeviceRemoved(it->second);
         delete it->second;
     }
     m_devs.clear();