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>
Owen Smith [Thu, 1 May 2014 11:32:10 +0000 (12:32 +0100)]
[CA-134598] Store the (partial) tag along with the XENVBD_REQUEST.
Migrate and a bus/target reset will re-queue any existing requests, but not
reset the request tagging correctly, and will eventually run out of free tags.
Paul Durrant [Tue, 22 Apr 2014 09:24:39 +0000 (10:24 +0100)]
Fix BSOD caused by KeWaitForMultipleObjects()
KeWaitForMultipleObjects() should use a wait block array if the
number of objects exceeds THREAD_WAIT_OBJECTS. The number of objects
PdoDestroy() waits on is 4 which exceeds the currently defined value
of that constant (which is 3).
Signed-off-by: Murtaza Ghiya <murtazg@amazon.com> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>