Owen Smith [Wed, 29 Jun 2016 15:24:40 +0000 (16:24 +0100)]
Set VM's time based on host's time exposed by Xen
Sets the VM's time when XenIface starts and on resume from suspend.
Uses the underlying host's time, accessed via Xen. Provide an option
for the guest to treat Xen's time as UTC or the current timezone.
This option adds 2 new brandable variables that specify a partial
registry path and value in the VM that determines how the time offset
is modified. These values are REG_TOOLS_PATH and REG_UTC_NAME which
should be specified in the build environment if the values need to
be different.
Signed-off-by: Owen Smith <owen.smith@citrix.com>
Changed REG_TOOLS_PATH to REG_KEY_NAME, which now defaults to 'Windows
PV Drivers' (that being the official XenProject sub-project name), and
use hard coded 'HostTime' key name instead of brandable REG_UTC_NAME.
If we have a brandable parent registry key, then we don't really need
to brand the value names under it.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Owen Smith [Tue, 28 Jun 2016 15:49:58 +0000 (16:49 +0100)]
Add Suspend and Shutdown handlers
Suspend needs to re-advertise the shutdown feature
Shutdown responds to control\shutdown to issue a shutdown, reboot,
hibernate or S3 transition.
Suitable event log entries are added when these events are triggered.
Owen Smith [Tue, 28 Jun 2016 12:18:53 +0000 (13:18 +0100)]
Track active device in service class
Hold a CriticalSection protected local pointer to the XenIfaceDevice
that is currently available. This will be used for all accesses to
the interfaces provided.
Owen Smith [Mon, 27 Jun 2016 16:19:47 +0000 (17:19 +0100)]
Add device list to track XenIface device(s)
Uses RegisterDeviceNotificationA and SetupApi to track
GUID_INTERFACE_XENIFACE device(s). Calls service base class
after insertion and before remove complete.
Signed-off-by: Owen Smith <owen.smith@citrix.com>
Fix VS2013 build.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Owen Smith [Mon, 27 Jun 2016 14:55:21 +0000 (15:55 +0100)]
Remove LiteAgent, replace with boilerplate xenagent service
Remove the LiteAgent project and replace it with the xenagent
project. Xenagent is a boilerplate service that has no
functionality in this patch. Subsiquent patches will add
the required functionality.
Signed-off-by: Owen Smith <owen.smith@citrix.com>
Fix VS2013 build.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Owen Smith [Mon, 27 Jun 2016 09:52:15 +0000 (10:52 +0100)]
Add Suspend IOCTL interface
Adds
* GetCount - returns a value which changes over suspend
* Register - registers an event that is set on resume from suspend
* Deregister - deregisters a resume from suspend event
Owen Smith [Mon, 27 Jun 2016 09:40:24 +0000 (10:40 +0100)]
Call XenIfaceCleanup from IRP_MJ_CLEANUP
XenIfaceCleanup was not called which meant that some watches, event
channels and grant entries were not cleaned up on closing the device
handle and required explicit cleanup. Add a IRP handler to call
XenIfaceCleanup from the IRP_MJ_CLEANUP for a specific FileObject.
This ensures all watches, event channels and grant entries are
destroyed in the event of the caller crashing or not gracefullly
cleaning up objects.
Paul Durrant [Thu, 10 Dec 2015 12:38:28 +0000 (12:38 +0000)]
Use a DPC per XENIFACE_EVTCHN_CONTEXT for signalling to user space
The scheme of using a DPC per CPU will not work when multiple event channels
are in use since events may be lost when channels bound to the same CPU
are simultaneously pending. The problem is avoided by simply having
separate DPCs for each channel.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Cc: Rafal Wojdyla <omeg@invisiblethingslab.com>
Paul Durrant [Thu, 10 Dec 2015 11:38:54 +0000 (11:38 +0000)]
Re-synchronize util.h with XENBUS and use __toupper()
A recent patch introduced __tolower() and __toupper() into util.h as
replacements for tolower() and toupper() respectively as the latter do
a hidden conversion to Unicode which make then unsafe at any IRQL other
than PASSIVE_LEVEL.
This patch imports util.h from XENBUS and fixes other code to be compatible.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Owen Smith [Tue, 17 Nov 2015 17:05:23 +0000 (17:05 +0000)]
Dont force a WMI event when reregistering a watch
When a watch is registered, the watch gets triggered. This will result
in a WMI event being fired. There is no need to manually fire a WMI
event in this case, as it can lead to the WMI event being discarded.
Paul Durrant [Thu, 22 Oct 2015 15:22:02 +0000 (16:22 +0100)]
Add a registry override to veto driver installations
There are certain cases where a local installer package may wish to
prevent Windows Update installations of drivers. This can be achieved by
having the co-installer check for a registry value and fail it's pre-install
phase if the value is present.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Tue, 8 Sep 2015 16:59:49 +0000 (17:59 +0100)]
Parameterize vendor prefix and PCI device id
The XenServer PV vendor prefix ('XS') and PCI device (C000) are still
hard-coded into the XENIFACE package. These need to be stripped out and
replaced by values that can be customized at build time. This patch does
that.
The patch also reverts to building version.h and customizing xeniface.inf
directly in build.py.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Fri, 17 Jul 2015 15:52:01 +0000 (16:52 +0100)]
Update bindings
A recent change to XENBUS to introduce a new unplug mechanism was
incompatible with older drivers so the PDO revisions were deliberately
changed. This patch brings XENIFACE up to date with the new revision
number.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Fri, 15 Aug 2014 13:22:17 +0000 (14:22 +0100)]
Update branding
Remove the use of the 'XenServer' product name except where it is
still appropriate.
Remove use of 'Citrix' from all places except source file
copyrights.
Allow company and product name to be set at build time.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Tue, 22 Jul 2014 14:28:56 +0000 (15:28 +0100)]
Implement new API version scheme
This patch changes the way APIs work in an incompatible way. (See README.md
for details).
The patch also includes a *lot* of code tidying and movement and as such
is not really suitable for review as a patch; the resulting code should
itself be reviewed.
Given the scale of the change, the major version number has been revised to
8 and other version numbers reset to zero.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Ben Chalmers [Thu, 9 Jan 2014 08:46:05 +0000 (08:46 +0000)]
[CA-119964] Remove a null dereferece which causes an exception
Also:
Free a XenStore allocation using XSFree
Spell XenServer correctly
Remove the debug eventlog message on shutdown (messages on resume from
suspend, wmi failure and unexpected error conditions remain as these
will be useful for issue identification)
Signed-off-by: Ben Chalmers <Ben.Chalmers@citrix.com>