[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[win-pv-devel] [PATCH] Add missing acquisition of the UNPLUG interface



Commit cba6dad2df306885dfc65908f14ce6e2d8a86211 changed the way that
emulated devices are unplugged. It used to be that XENFILT waited until it
detected the presence of the 'active' device that XENBUS bound to before
deciding whether to unplug, but that commit simply made sure that the
'active' device always appears unless something has drastically changed in
the VM configuration. Unfortunately, in making that change, the code that
acquired the initial reference to the unplug interface - and thereby caused
emulated devices to be unplugged - was lost. This patch adds in the missing
acquisition.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
---
 src/xenfilt/driver.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/xenfilt/driver.c b/src/xenfilt/driver.c
index 01661aa..86c6800 100644
--- a/src/xenfilt/driver.c
+++ b/src/xenfilt/driver.c
@@ -59,7 +59,6 @@ typedef struct _XENFILT_DRIVER {
 
     XENFILT_EMULATED_INTERFACE  EmulatedInterface;
     XENFILT_UNPLUG_INTERFACE    UnplugInterface;
-    BOOLEAN                     UnplugAcquired;
 } XENFILT_DRIVER, *PXENFILT_DRIVER;
 
 static XENFILT_DRIVER   Driver;
@@ -305,10 +304,7 @@ DriverUnload(
     if (*InitSafeBootMode > 0)
         goto done;
 
-    if (Driver.UnplugAcquired) {
-        XENFILT_UNPLUG(Release, &Driver.UnplugInterface);
-        Driver.UnplugAcquired = FALSE;
-    }
+    XENFILT_UNPLUG(Release, &Driver.UnplugInterface);
 
     XENFILT_EMULATED(Release, &Driver.EmulatedInterface);
 
@@ -679,6 +675,10 @@ DriverEntry(
     if (!NT_SUCCESS(status))
         goto fail8;
 
+    status = XENFILT_UNPLUG(Acquire, &Driver.UnplugInterface);
+    if (!NT_SUCCESS(status))
+        goto fail9;
+
     RegistryCloseKey(ServiceKey);
 
     DriverObject->DriverExtension->AddDevice = DriverAddDevice;
@@ -693,6 +693,11 @@ done:
     Trace("<====\n");
     return STATUS_SUCCESS;
 
+fail9:
+    Error("fail9\n");
+
+    XENFILT_EMULATED(Release, &Driver.EmulatedInterface);
+
 fail8:
     Error("fail8\n");
 
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.