Paul Durrant [Mon, 29 Feb 2016 10:20:50 +0000 (10:20 +0000)]
Override PartMgr SanPolicy
This patch makes sure that PartMgr's SanPolicy is 1 after XENVBD
installation, which means that newly plugged VBDs will come online as most
admins will expect.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Dave Buches [Fri, 22 Jan 2016 04:30:03 +0000 (20:30 -0800)]
Fixed improper SCSI UNMAP request implementation
The XenDisk disk class filter driver was generating requests
that did not adhere to the t10 SBC-3 SCSI specification for UNMAP
operations. Specifically, the data length and block descriptor data
length fields were not populated properly per the spec.
Although the XenVBD miniport driver handled these malformed
requests correctly, it failed to handle *properly* formed requests,
which would result in unpredictable behavior.
Additionally, the XenDisk filter wasn't properly responding to
StorageDeviceTrimProperty queries per the MSDN spec. Specifically,
the DEVICE_TRIM_DESCRIPTOR::Version structure member needs to be set
to sizeof(DEVICE_TRIM_DESCRIPTOR).
Paul Durrant [Thu, 10 Dec 2015 11:39:37 +0000 (11:39 +0000)]
Don't use C runtime version of toupper()
It seems that, despite its trivial functionality, the runtime implementation
insists on converting to Unicode! This means the function is actually only
safe at PASSIVE_LEVEL.
This patch implements __toupper() as a replacement with no such hidden
nastiness and modifies callers to use that.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Owen Smith [Wed, 2 Dec 2015 15:16:49 +0000 (15:16 +0000)]
Remove BlockRing.Outstanding / BlockRingAbort
The BlockRing Outstanding stat is duplicated by SubmittedReqs.Count.
Remove BlockRing.Outstanding and the BlockRingAbort function as the
stat is not useful, and can trigger ASSERTion failures when requests
are stuck outstanding on a broken ring that is being destroyed.
Paul Durrant [Tue, 24 Nov 2015 17:47:59 +0000 (17:47 +0000)]
Publish distribution information and hotplug capability to xenstore
My recent patch series to Xen added a documented path and format for
publishing information about PV driver distributions and hotplug
capability to xenstore.
This patch adds code to populate the documented paths (should they exist)
with information about the XENVBD driver package and the driver's ability
to handle hotplug events.
Suggested-by: Owen Smith <owen.smith@citrix.com> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Owen Smith [Thu, 22 Oct 2015 13:13:48 +0000 (14:13 +0100)]
Kick notifier DPC directly.
EVTCHN(Trigger, ...) was changed with the FiFo event channel
implementation, which led to a performance regression. Kicking
the notifier does not require triggering the local end of the
event channel, so shortcut this process by queueing the notifier
DPC directly.
Paul Durrant [Thu, 22 Oct 2015 14:55:20 +0000 (15:55 +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:36:00 +0000 (17:36 +0100)]
Parameterize vendor prefix and PCI device id
The XenServer PV vendor prefix ('XS') and PCI device (C000) are still
hard-coded into the XENVBD 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 xenvbd.inf
directly in build.py.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Thu, 3 Sep 2015 16:36:43 +0000 (17:36 +0100)]
Clear unplug requests from co-installer
When XENVBD is uninstalled there is no suitable notification in kernel
which can be used to clear any remaining unplug requests. This leads to
a certain 0x7B bugcheck on reboot. This patch therefore does the job
from the co-installer since this seems to be the only way.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Thu, 3 Sep 2015 16:22:35 +0000 (17:22 +0100)]
Simplify unplug request
Since the PDO driver in XENVBD's case is in-box, we don't need to defer
requesting emulated device unplug to when PDOs are started, we can do it
when the FDO is started.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Tue, 11 Aug 2015 08:09:01 +0000 (09:09 +0100)]
Reduce the number of registered watches per target
XENVBD registers watches for changes in various per-VBD backend quantities,
e.g. state. All these watches, however, trigger one common event and so it
is wasteful of the guest's watch quota. Instead register a single watch on
the backend key, which will fire if any key below it is modified. This may
cause the event to be set slightly more often, but saves 3 watches per
target.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Fri, 7 Aug 2015 16:03:16 +0000 (17:03 +0100)]
Set per-disk queue depth
Windows apparently defaults to a queue depth of 20, which is a bit on the
small side. This patch sets the value to the maximum possible, which is
apparently 254 instead of the documented 255.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Wed, 22 Jul 2015 15:44:49 +0000 (16:44 +0100)]
Add missing unplug request
If a new target is enumerated during a device relations query then no
request is made for unplug, or reboot. This patch adds the necessary code
to rectify this issue.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Mon, 15 Jun 2015 11:10:45 +0000 (12:10 +0100)]
Fix device relations in xendisk filter
Incorrect handling breaks device removal. The crucial point is that a
PDO in the case of a filter should always disappear when an
IRP_MN_REMOVE_DEVICE comes down the stack. It does not need to stick around
in some cases, like a true PDO.
Signed-off-by: Ghiya, Murtaza <murtazg@amazon.com> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Tue, 24 Feb 2015 11:50:38 +0000 (11:50 +0000)]
Make sure we only use the first 32 (-8) grant entries for crash kernel
XENBUS only uses grant entries 32 onwards so that the first 32 (minus the 8
reserved entries) are clean for the crash kernel. This patch makes sure that
the crash kernel does not go over that limit.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Fri, 30 Jan 2015 13:44:42 +0000 (13:44 +0000)]
Insertion into head of austere heap misses setting reverse link
The heap is maintained as a doubly linked list of objects but both
__AllocSmall() and __FreeSmall() are missing setup of the reverse link when
a new object is inserted at the head. This patch adds the necessary fix.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Reported-by: Gregory Jacklin <jackling@amazon.com>
Ben Chalmers [Tue, 20 Jan 2015 14:27:19 +0000 (14:27 +0000)]
Protect BackendPath from race using StateLock
The BackendPath can change as part of PDO state transitions, leading
to a race with the frontend thread. Since the frontend state lock is
locked through state transitions, taking the lock is sufficient to
avoid the race
Signed-off-by: Ben Chalmers <Ben.Chalmers@citrix.com>
Owen Smith [Tue, 20 Jan 2015 13:54:01 +0000 (13:54 +0000)]
Ignore invalid devices
When a floppy drive is attached, the device id string cannot be parsed
into a valid xvd, sd? or hd? format. Report the error instead of asserting
and return the invalid value to ignore the device in question.
Paul Durrant [Thu, 8 Jan 2015 13:44:15 +0000 (13:44 +0000)]
Handle storage query ioctls properly
Both the ioctls we care about are METHOD_BUFFERED so ASSERT that and then
use the associated IRP SystemBuffer, remembering to verify input and output
sizes.
Also we should only return (or expect returned) data in the case of a full
query, as opposed to an existence query.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Owen Smith [Tue, 28 Oct 2014 11:27:24 +0000 (11:27 +0000)]
Add XenDisk device upper filter.
XenDisk intercepts and translates IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES
into SCSIOP_UNMAP SRBs. Storport will pass on these SCSIOP_UNMAP requests
to XenVbd, which will create the appropriate BLKIF_OP_DISCARD requests.
XenDisk is only neccessary because Storport does not do the translation
to SCSIOP_UNMAPs.
Signed-off-by: Owen Smith <owen.smith@citrix.com> Acked-by: Paul Durrant <paul.durrant@citrix.com>
Owen Smith [Tue, 28 Oct 2014 11:27:22 +0000 (11:27 +0000)]
Prepare SCSIOP_UNMAP correctly
SCSIOP_UNMAP requests contain a list of extents to discard
and each BLKIF_OP_DISCARD only handles a single extent.
Break a SRB doen into multiple ring requests as necessary.
Signed-off-by: Owen Smith <owen.smith@citrix.com> Acked-by: Paul Durrant <paul.durrant@citrix.com>
Owen Smith [Thu, 4 Sep 2014 08:28:05 +0000 (09:28 +0100)]
Re-read features after Connect
blkback incorrectly writes features before setting Connected instead
of before setting InitWait. Re-read these values after backend goes
Connected, to get the current value.
Note: Some values *must* be written before setting Connected, as
blkback can only discover these values by connecting to the underlying
storage.
Owen Smith [Thu, 4 Sep 2014 08:19:40 +0000 (09:19 +0100)]
Fix BLKIF_OP_INDIRECT protocol requests
Fixes an issue with indirect requests that arose due to changes in
XenBus's (7.x) grant table interface (v3 to v4). Refactored for the
8.0 version of XenBus.
Rework internal request structures to contain a list of segments.
Number of segments determines the difference between direct and
indirect operations.
blkback is limited to 256 segments per indirect request, XenVbd
reports support for 175 physical breaks (i.e. segments).
Paul Durrant [Thu, 14 Aug 2014 16:46:39 +0000 (17:46 +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 [Wed, 23 Jul 2014 08:40:54 +0000 (09:40 +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>