]> xenbits.xensource.com Git - pvdrivers/win/xenbus.git/commitdiff
Relax check for new bindings
authorOwen Smith <owen.smith@citrix.com>
Tue, 26 Jun 2018 11:17:32 +0000 (12:17 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Tue, 26 Jun 2018 11:17:32 +0000 (12:17 +0100)
Only if the major version part of the revision changes is it unsafe to
update the drivers without removing the unplug keys (thereby forcing a
fallback to emulated devices on the next reboot). Minor version changes
should be backwards compatible (within a reasonable time-frame).

Signed-off-by: Owen Smith <owen.smith@citrix.com>
Edited commit comment.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/coinst/coinst.c

index f19d108b7352f62cdf28466885f4f4562759cc69..fa899f300ae59ecf03f09e2faeb3c33687096a71 100644 (file)
@@ -999,6 +999,7 @@ SupportDeviceID(
     unsigned int    Revision;
     int             Count;
     DWORD           Index;
+    DWORD           LatestRevision;
     HRESULT         Error;
 
     DeviceID = strrchr(DeviceID, '&');
@@ -1022,9 +1023,10 @@ SupportDeviceID(
     goto fail2;
 
 found:
-    // If we don't match the latest revision then it means the driver
-    // binding will change.
-    if (Index < ARRAYSIZE(DeviceRevision) - 1)
+    // If major part of the child device's revision does not match the major
+    // part of the latest revision then it means the driver binding will change.
+    LatestRevision = DeviceRevision[ARRAYSIZE(DeviceRevision) - 1];
+    if ((Revision & 0xFF000000) != (LatestRevision & 0xFF000000))
         *NewBinding = TRUE;
 
     Log("%x", Revision);