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

[win-pv-devel] [PATCH 1/5] Query for CACHE interface



From: Owen Smith <owen.smith@xxxxxxxxxx>

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 src/xenvbd/adapter.c | 49 +++++++++++++++++++++++++++++++++----------------
 src/xenvbd/adapter.h |  2 ++
 2 files changed, 35 insertions(+), 16 deletions(-)

diff --git a/src/xenvbd/adapter.c b/src/xenvbd/adapter.c
index a4220d1..59724bb 100644
--- a/src/xenvbd/adapter.c
+++ b/src/xenvbd/adapter.c
@@ -38,6 +38,7 @@
 #include <version.h>
 #include <xencdb.h>
 #include <names.h>
+#include <cache_interface.h>
 #include <store_interface.h>
 #include <evtchn_interface.h>
 #include <gnttab_interface.h>
@@ -71,6 +72,7 @@ struct _XENVBD_ADAPTER {
     PXENVBD_THREAD              DevicePowerThread;
     PIRP                        DevicePowerIrp;
 
+    XENBUS_CACHE_INTERFACE      CacheInterface;
     XENBUS_EVTCHN_INTERFACE     EvtchnInterface;
     XENBUS_STORE_INTERFACE      StoreInterface;
     XENBUS_GNTTAB_INTERFACE     GnttabInterface;
@@ -1220,68 +1222,79 @@ AdapterInitialize(
         goto fail3;
 
     status = AdapterQueryInterface(Adapter,
+                                   XENBUS_CACHE,
+                                   &Adapter->CacheInterface,
+                                   FALSE);
+    if (!NT_SUCCESS(status))
+        goto fail4;
+
+    status = AdapterQueryInterface(Adapter,
                                    XENBUS_SUSPEND,
                                    &Adapter->SuspendInterface,
                                    FALSE);
     if (!NT_SUCCESS(status))
-        goto fail4;
+        goto fail5;
 
     status = AdapterQueryInterface(Adapter,
                                    XENBUS_DEBUG,
                                    &Adapter->DebugInterface,
                                    FALSE);
     if (!NT_SUCCESS(status))
-        goto fail5;
+        goto fail6;
 
     status = AdapterQueryInterface(Adapter,
                                    XENBUS_UNPLUG,
                                    &Adapter->UnplugInterface,
                                    FALSE);
     if (!NT_SUCCESS(status))
-        goto fail6;
+        goto fail7;
 
     status = AdapterQueryInterface(Adapter,
                                    XENFILT_EMULATED,
                                    &Adapter->EmulatedInterface,
                                    TRUE);
     if (!NT_SUCCESS(status))
-        goto fail7;
+        goto fail8;
 
     status = ThreadCreate(AdapterScanThread,
                           Adapter,
                           &Adapter->ScanThread);
     if (!NT_SUCCESS(status))
-        goto fail8;
+        goto fail9;
 
     status = ThreadCreate(AdapterDevicePowerThread,
                           Adapter,
                           &Adapter->DevicePowerThread);
     if (!NT_SUCCESS(status))
-        goto fail9;
+        goto fail10;
 
     return STATUS_SUCCESS;
 
-fail9:
-    Error("fail9\n");
+fail10:
+    Error("fail10\n");
     ThreadAlert(Adapter->ScanThread);
     ThreadJoin(Adapter->ScanThread);
     Adapter->ScanThread = NULL;
-fail8:
-    Error("fail8\n");
+fail9:
+    Error("fail9\n");
     RtlZeroMemory(&Adapter->EmulatedInterface,
                   sizeof (XENFILT_EMULATED_INTERFACE));
-fail7:
-    Error("fail7\n");
+fail8:
+    Error("fail8\n");
     RtlZeroMemory(&Adapter->UnplugInterface,
                   sizeof (XENBUS_UNPLUG_INTERFACE));
-fail6:
-    Error("fail6\n");
+fail7:
+    Error("fail7\n");
     RtlZeroMemory(&Adapter->DebugInterface,
                   sizeof (XENBUS_DEBUG_INTERFACE));
-fail5:
-    Error("fail5\n");
+fail6:
+    Error("fail6\n");
     RtlZeroMemory(&Adapter->SuspendInterface,
                   sizeof (XENBUS_SUSPEND_INTERFACE));
+fail5:
+    Error("fail5\n");
+    RtlZeroMemory(&Adapter->CacheInterface,
+                  sizeof (XENBUS_CACHE_INTERFACE));
 fail4:
     Error("fail4\n");
     RtlZeroMemory(&Adapter->GnttabInterface,
@@ -1352,6 +1365,9 @@ AdapterTeardown(
     RtlZeroMemory(&Adapter->SuspendInterface,
                   sizeof (XENBUS_SUSPEND_INTERFACE));
 
+    RtlZeroMemory(&Adapter->CacheInterface,
+                  sizeof (XENBUS_CACHE_INTERFACE));
+
     RtlZeroMemory(&Adapter->GnttabInterface,
                   sizeof (XENBUS_GNTTAB_INTERFACE));
 
@@ -2077,6 +2093,7 @@ AdapterGet ## _name ## Interface(                         
      \
     * ## _name ## Interface = Adapter-> ## _name ## Interface;  \
 }
 
+ADAPTER_GET_INTERFACE(Cache, PXENBUS_CACHE_INTERFACE)
 ADAPTER_GET_INTERFACE(Store, PXENBUS_STORE_INTERFACE)
 ADAPTER_GET_INTERFACE(Debug, PXENBUS_DEBUG_INTERFACE)
 ADAPTER_GET_INTERFACE(Evtchn, PXENBUS_EVTCHN_INTERFACE)
diff --git a/src/xenvbd/adapter.h b/src/xenvbd/adapter.h
index ce0c794..25febc1 100644
--- a/src/xenvbd/adapter.h
+++ b/src/xenvbd/adapter.h
@@ -36,6 +36,7 @@
 
 typedef struct _XENVBD_ADAPTER XENVBD_ADAPTER, *PXENVBD_ADAPTER;
 
+#include <cache_interface.h>
 #include <store_interface.h>
 #include <evtchn_interface.h>
 #include <gnttab_interface.h>
@@ -51,6 +52,7 @@ AdapterGet ## _name ## Interface(               \
     OUT _type           _name ## Interface      \
     );
 
+ADAPTER_GET_INTERFACE(Cache, PXENBUS_CACHE_INTERFACE)
 ADAPTER_GET_INTERFACE(Store, PXENBUS_STORE_INTERFACE)
 ADAPTER_GET_INTERFACE(Debug, PXENBUS_DEBUG_INTERFACE)
 ADAPTER_GET_INTERFACE(Evtchn, PXENBUS_EVTCHN_INTERFACE)
-- 
2.8.3


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
https://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®.