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

[PATCH xenvbd] Bring XENBUS interface versions up to date...



From: Paul Durrant <pdurrant@xxxxxxxxxx>

... and amend binding accordingly.

Signed-off-by: Paul Durrant <pdurrant@xxxxxxxxxx>
---
 include/cache_interface.h  | 34 ++++++++++++++++++++++++++--
 include/evtchn_interface.h | 46 +++++++++++++++++++++-----------------
 include/gnttab_interface.h | 44 ++++++++++++++++++++++++------------
 include/store_interface.h  | 22 +-----------------
 src/xenvbd.inf             |  6 ++---
 src/xenvbd/adapter.c       |  1 +
 src/xenvbd/granter.c       |  1 +
 src/xenvbd/ring.c          |  3 +++
 8 files changed, 96 insertions(+), 61 deletions(-)

diff --git a/include/cache_interface.h b/include/cache_interface.h
index dae3ac6d556c..ce50f4e46376 100644
--- a/include/cache_interface.h
+++ b/include/cache_interface.h
@@ -123,6 +123,20 @@ typedef VOID
     IN  PVOID   Argument
     );
 
+typedef NTSTATUS
+(*XENBUS_CACHE_CREATE_V1)(
+    IN  PINTERFACE                  Interface,
+    IN  const CHAR                  *Name,
+    IN  ULONG                       Size,
+    IN  ULONG                       Reservation,
+    IN  XENBUS_CACHE_CTOR           Ctor,
+    IN  XENBUS_CACHE_DTOR           Dtor,
+    IN  XENBUS_CACHE_ACQUIRE_LOCK   AcquireLock,
+    IN  XENBUS_CACHE_RELEASE_LOCK   ReleaseLock,
+    IN  PVOID                       Argument OPTIONAL,
+    OUT PXENBUS_CACHE               *Cache
+    );
+
 /*! \typedef XENBUS_CACHE_CREATE
     \brief Create a cache of objects of the given \a Size
 
@@ -130,6 +144,7 @@ typedef VOID
     \param Name A name for the cache which will be used in debug output
     \param Size The size of each object in bytes
     \param Reservation The target minimum population of the cache
+    \param Cap The maximum population of the cache
     \param Ctor A callback which is invoked when a new object created
     \param Dtor A callback which is invoked when an object is destroyed
     \param AcquireLock A callback invoked to acquire a spinlock
@@ -146,6 +161,7 @@ typedef NTSTATUS
     IN  const CHAR                  *Name,
     IN  ULONG                       Size,
     IN  ULONG                       Reservation,
+    IN  ULONG                       Cap,
     IN  XENBUS_CACHE_CTOR           Ctor,
     IN  XENBUS_CACHE_DTOR           Dtor,
     IN  XENBUS_CACHE_ACQUIRE_LOCK   AcquireLock,
@@ -208,6 +224,20 @@ DEFINE_GUID(GUID_XENBUS_CACHE_INTERFACE,
     \ingroup interfaces
 */
 struct _XENBUS_CACHE_INTERFACE_V1 {
+    INTERFACE               Interface;
+    XENBUS_CACHE_ACQUIRE    CacheAcquire;
+    XENBUS_CACHE_RELEASE    CacheRelease;
+    XENBUS_CACHE_CREATE_V1  CacheCreateVersion1;
+    XENBUS_CACHE_GET        CacheGet;
+    XENBUS_CACHE_PUT        CachePut;
+    XENBUS_CACHE_DESTROY    CacheDestroy;
+};
+
+/*! \struct _XENBUS_CACHE_INTERFACE_V2
+    \brief CACHE interface version 1
+    \ingroup interfaces
+*/
+struct _XENBUS_CACHE_INTERFACE_V2 {
     INTERFACE               Interface;
     XENBUS_CACHE_ACQUIRE    CacheAcquire;
     XENBUS_CACHE_RELEASE    CacheRelease;
@@ -217,7 +247,7 @@ struct _XENBUS_CACHE_INTERFACE_V1 {
     XENBUS_CACHE_DESTROY    CacheDestroy;
 };
 
-typedef struct _XENBUS_CACHE_INTERFACE_V1 XENBUS_CACHE_INTERFACE, 
*PXENBUS_CACHE_INTERFACE;
+typedef struct _XENBUS_CACHE_INTERFACE_V2 XENBUS_CACHE_INTERFACE, 
*PXENBUS_CACHE_INTERFACE;
 
 /*! \def XENBUS_CACHE
     \brief Macro at assist in method invocation
@@ -228,6 +258,6 @@ typedef struct _XENBUS_CACHE_INTERFACE_V1 
XENBUS_CACHE_INTERFACE, *PXENBUS_CACHE
 #endif  // _WINDLL
 
 #define XENBUS_CACHE_INTERFACE_VERSION_MIN  1
-#define XENBUS_CACHE_INTERFACE_VERSION_MAX  1
+#define XENBUS_CACHE_INTERFACE_VERSION_MAX  2
 
 #endif  // _XENBUS_CACHE_INTERFACE_H
diff --git a/include/evtchn_interface.h b/include/evtchn_interface.h
index 068a69734fe9..05c342e50db8 100644
--- a/include/evtchn_interface.h
+++ b/include/evtchn_interface.h
@@ -100,6 +100,8 @@ typedef VOID
 
     \b VIRQ:
     \param Index The index number of the VIRQ
+    \param Group The group number of the CPU that should handle the VIRQ
+    \param Number The relative number of the CPU that should handle the VIRQ
 
     \return Event channel handle
 */  
@@ -141,7 +143,7 @@ typedef VOID
     \param Interface The interface header
     \param Channel The channel handle
     \param InCallback Set to TRUE if this method is invoked in context of the 
channel callback
-    \param Force Set to TRUE if the unmask must succeed, otherwise set to 
FALSE and the function will return FALSE if the unmask did not complete.
+    \param Force Set to TRUE if the unmask must succeed, otherwise set to 
FALSE and the function will return TRUE if the unmask did not complete and 
there is still an event pending.
 */
 typedef BOOLEAN
 (*XENBUS_EVTCHN_UNMASK)(
@@ -249,23 +251,6 @@ typedef VOID
 DEFINE_GUID(GUID_XENBUS_EVTCHN_INTERFACE, 
 0xbe2440ac, 0x1098, 0x4150, 0xaf, 0x4d, 0x45, 0x2f, 0xad, 0xce, 0xf9, 0x23);
 
-/*! \struct _XENBUS_EVTCHN_INTERFACE_V4
-    \brief EVTCHN interface version 4
-    \ingroup interfaces
-*/
-struct _XENBUS_EVTCHN_INTERFACE_V4 {
-    INTERFACE               Interface;
-    XENBUS_EVTCHN_ACQUIRE   EvtchnAcquire;
-    XENBUS_EVTCHN_RELEASE   EvtchnRelease;
-    XENBUS_EVTCHN_OPEN      EvtchnOpen;
-    XENBUS_EVTCHN_BIND      EvtchnBind;
-    XENBUS_EVTCHN_UNMASK_V4 EvtchnUnmaskVersion4;
-    XENBUS_EVTCHN_SEND_V1   EvtchnSendVersion1;
-    XENBUS_EVTCHN_TRIGGER   EvtchnTrigger;
-    XENBUS_EVTCHN_GET_PORT  EvtchnGetPort;
-    XENBUS_EVTCHN_CLOSE     EvtchnClose;
-};
-
 /*! \struct _XENBUS_EVTCHN_INTERFACE_V5
     \brief EVTCHN interface version 5
     \ingroup interfaces
@@ -340,7 +325,26 @@ struct _XENBUS_EVTCHN_INTERFACE_V8 {
     XENBUS_EVTCHN_CLOSE     EvtchnClose;
 };
 
-typedef struct _XENBUS_EVTCHN_INTERFACE_V8 XENBUS_EVTCHN_INTERFACE, 
*PXENBUS_EVTCHN_INTERFACE;
+/*! \struct _XENBUS_EVTCHN_INTERFACE_V9
+    \brief EVTCHN interface version 9
+    \ingroup interfaces
+*/
+struct _XENBUS_EVTCHN_INTERFACE_V9 {
+    INTERFACE               Interface;
+    XENBUS_EVTCHN_ACQUIRE   EvtchnAcquire;
+    XENBUS_EVTCHN_RELEASE   EvtchnRelease;
+    XENBUS_EVTCHN_OPEN      EvtchnOpen;
+    XENBUS_EVTCHN_BIND      EvtchnBind;
+    XENBUS_EVTCHN_UNMASK    EvtchnUnmask;
+    XENBUS_EVTCHN_SEND      EvtchnSend;
+    XENBUS_EVTCHN_TRIGGER   EvtchnTrigger;
+    XENBUS_EVTCHN_GET_COUNT EvtchnGetCount;
+    XENBUS_EVTCHN_WAIT      EvtchnWait;
+    XENBUS_EVTCHN_GET_PORT  EvtchnGetPort;
+    XENBUS_EVTCHN_CLOSE     EvtchnClose;
+};
+
+typedef struct _XENBUS_EVTCHN_INTERFACE_V9 XENBUS_EVTCHN_INTERFACE, 
*PXENBUS_EVTCHN_INTERFACE;
 
 /*! \def XENBUS_EVTCHN
     \brief Macro at assist in method invocation
@@ -350,8 +354,8 @@ typedef struct _XENBUS_EVTCHN_INTERFACE_V8 
XENBUS_EVTCHN_INTERFACE, *PXENBUS_EVT
 
 #endif  // _WINDLL
 
-#define XENBUS_EVTCHN_INTERFACE_VERSION_MIN 4
-#define XENBUS_EVTCHN_INTERFACE_VERSION_MAX 8
+#define XENBUS_EVTCHN_INTERFACE_VERSION_MIN 5
+#define XENBUS_EVTCHN_INTERFACE_VERSION_MAX 9
 
 #endif  // _XENBUS_EVTCHN_INTERFACE_H
 
diff --git a/include/gnttab_interface.h b/include/gnttab_interface.h
index 61272ab41cb3..e3ee888bd979 100644
--- a/include/gnttab_interface.h
+++ b/include/gnttab_interface.h
@@ -72,12 +72,24 @@ typedef VOID
     IN  PINTERFACE  Interface
     );
 
+typedef NTSTATUS
+(*XENBUS_GNTTAB_CREATE_CACHE_V1)(
+    IN  PINTERFACE                  Interface,
+    IN  const CHAR                  *Name,
+    IN  ULONG                       Reservation,
+    IN  XENBUS_CACHE_ACQUIRE_LOCK   AcquireLock,
+    IN  XENBUS_CACHE_RELEASE_LOCK   ReleaseLock,
+    IN  PVOID                       Argument OPTIONAL,
+    OUT PXENBUS_GNTTAB_CACHE        *Cache
+    );
+
 /*! \typedef XENBUS_GNTTAB_CREATE_CACHE
     \brief Create a cache of grant table entries
 
     \param Interface The interface header
     \param Name A name for the cache which will be used in debug output
     \param Reservation The target minimum population of the cache
+    \param Cap The maximum population of the cache
     \param AcquireLock A callback invoked to acquire a spinlock
     \param ReleaseLock A callback invoked to release the spinlock
     \param Argument An optional context argument passed to the callbacks
@@ -88,6 +100,7 @@ typedef NTSTATUS
     IN  PINTERFACE                  Interface,
     IN  const CHAR                  *Name,
     IN  ULONG                       Reservation,
+    IN  ULONG                       Cap,
     IN  XENBUS_CACHE_ACQUIRE_LOCK   AcquireLock,
     IN  XENBUS_CACHE_RELEASE_LOCK   ReleaseLock,
     IN  PVOID                       Argument OPTIONAL,
@@ -220,43 +233,46 @@ typedef NTSTATUS
 DEFINE_GUID(GUID_XENBUS_GNTTAB_INTERFACE, 
 0x763679c5, 0xe5c2, 0x4a6d, 0x8b, 0x88, 0x6b, 0xb0, 0x2e, 0xc4, 0x2d, 0x8e);
 
-/*! \struct _XENBUS_GNTTAB_INTERFACE_V1
-    \brief GNTTAB interface version 1
+/*! \struct _XENBUS_GNTTAB_INTERFACE_V2
+    \brief GNTTAB interface version 2
     \ingroup interfaces
 */
-struct _XENBUS_GNTTAB_INTERFACE_V1 {
+struct _XENBUS_GNTTAB_INTERFACE_V2 {
     INTERFACE                           Interface;
     XENBUS_GNTTAB_ACQUIRE               GnttabAcquire;
     XENBUS_GNTTAB_RELEASE               GnttabRelease;
-    XENBUS_GNTTAB_CREATE_CACHE          GnttabCreateCache;
+    XENBUS_GNTTAB_CREATE_CACHE_V1       GnttabCreateCacheVersion1;
     XENBUS_GNTTAB_PERMIT_FOREIGN_ACCESS GnttabPermitForeignAccess;
     XENBUS_GNTTAB_REVOKE_FOREIGN_ACCESS GnttabRevokeForeignAccess;
     XENBUS_GNTTAB_GET_REFERENCE         GnttabGetReference;
     XENBUS_GNTTAB_DESTROY_CACHE         GnttabDestroyCache;
+    XENBUS_GNTTAB_MAP_FOREIGN_PAGES     GnttabMapForeignPages;
+    XENBUS_GNTTAB_UNMAP_FOREIGN_PAGES   GnttabUnmapForeignPages;
 };
 
-/*! \struct _XENBUS_GNTTAB_INTERFACE_V2
-    \brief GNTTAB interface version 2
+/*! \struct _XENBUS_GNTTAB_INTERFACE_V3
+    \brief GNTTAB interface version 3
     \ingroup interfaces
 */
-struct _XENBUS_GNTTAB_INTERFACE_V2 {
+struct _XENBUS_GNTTAB_INTERFACE_V3 {
     INTERFACE                           Interface;
     XENBUS_GNTTAB_ACQUIRE               GnttabAcquire;
     XENBUS_GNTTAB_RELEASE               GnttabRelease;
-    XENBUS_GNTTAB_CREATE_CACHE          GnttabCreateCache;
+    XENBUS_GNTTAB_CREATE_CACHE_V1       GnttabCreateCacheVersion1;
     XENBUS_GNTTAB_PERMIT_FOREIGN_ACCESS GnttabPermitForeignAccess;
     XENBUS_GNTTAB_REVOKE_FOREIGN_ACCESS GnttabRevokeForeignAccess;
     XENBUS_GNTTAB_GET_REFERENCE         GnttabGetReference;
+    XENBUS_GNTTAB_QUERY_REFERENCE       GnttabQueryReference;
     XENBUS_GNTTAB_DESTROY_CACHE         GnttabDestroyCache;
     XENBUS_GNTTAB_MAP_FOREIGN_PAGES     GnttabMapForeignPages;
     XENBUS_GNTTAB_UNMAP_FOREIGN_PAGES   GnttabUnmapForeignPages;
 };
 
-/*! \struct _XENBUS_GNTTAB_INTERFACE_V3
-    \brief GNTTAB interface version 3
+/*! \struct _XENBUS_GNTTAB_INTERFACE_V4
+    \brief GNTTAB interface version 4
     \ingroup interfaces
 */
-struct _XENBUS_GNTTAB_INTERFACE_V3 {
+struct _XENBUS_GNTTAB_INTERFACE_V4 {
     INTERFACE                           Interface;
     XENBUS_GNTTAB_ACQUIRE               GnttabAcquire;
     XENBUS_GNTTAB_RELEASE               GnttabRelease;
@@ -270,7 +286,7 @@ struct _XENBUS_GNTTAB_INTERFACE_V3 {
     XENBUS_GNTTAB_UNMAP_FOREIGN_PAGES   GnttabUnmapForeignPages;
 };
 
-typedef struct _XENBUS_GNTTAB_INTERFACE_V3 XENBUS_GNTTAB_INTERFACE, 
*PXENBUS_GNTTAB_INTERFACE;
+typedef struct _XENBUS_GNTTAB_INTERFACE_V4 XENBUS_GNTTAB_INTERFACE, 
*PXENBUS_GNTTAB_INTERFACE;
 
 /*! \def XENBUS_GNTTAB
     \brief Macro at assist in method invocation
@@ -280,8 +296,8 @@ typedef struct _XENBUS_GNTTAB_INTERFACE_V3 
XENBUS_GNTTAB_INTERFACE, *PXENBUS_GNT
 
 #endif  // _WINDLL
 
-#define XENBUS_GNTTAB_INTERFACE_VERSION_MIN 1
-#define XENBUS_GNTTAB_INTERFACE_VERSION_MAX 3
+#define XENBUS_GNTTAB_INTERFACE_VERSION_MIN 2
+#define XENBUS_GNTTAB_INTERFACE_VERSION_MAX 4
 
 #endif  // _XENBUS_GNTTAB_INTERFACE_H
 
diff --git a/include/store_interface.h b/include/store_interface.h
index 52f1a1dde592..e1251dd1369f 100644
--- a/include/store_interface.h
+++ b/include/store_interface.h
@@ -290,26 +290,6 @@ typedef NTSTATUS
 DEFINE_GUID(GUID_XENBUS_STORE_INTERFACE, 
 0x86824c3b, 0xd34e, 0x4753, 0xb2, 0x81, 0x2f, 0x1e, 0x3a, 0xd2, 0x14, 0xd7);
 
-/*! \struct _XENBUS_STORE_INTERFACE_V1
-    \brief STORE interface version 1
-    \ingroup interfaces
-*/
-struct _XENBUS_STORE_INTERFACE_V1 {
-    INTERFACE                       Interface;
-    XENBUS_STORE_ACQUIRE            StoreAcquire;
-    XENBUS_STORE_RELEASE            StoreRelease;
-    XENBUS_STORE_FREE               StoreFree;
-    XENBUS_STORE_READ               StoreRead;
-    XENBUS_STORE_PRINTF             StorePrintf;
-    XENBUS_STORE_REMOVE             StoreRemove;
-    XENBUS_STORE_DIRECTORY          StoreDirectory;
-    XENBUS_STORE_TRANSACTION_START  StoreTransactionStart;
-    XENBUS_STORE_TRANSACTION_END    StoreTransactionEnd;
-    XENBUS_STORE_WATCH_ADD          StoreWatchAdd;
-    XENBUS_STORE_WATCH_REMOVE       StoreWatchRemove;
-    XENBUS_STORE_POLL               StorePoll;
-};
-
 /*! \struct _XENBUS_STORE_INTERFACE_V2
     \brief STORE interface version 2
     \ingroup interfaces
@@ -341,7 +321,7 @@ typedef struct _XENBUS_STORE_INTERFACE_V2 
XENBUS_STORE_INTERFACE, *PXENBUS_STORE
 
 #endif  // _WINDLL
 
-#define XENBUS_STORE_INTERFACE_VERSION_MIN  1
+#define XENBUS_STORE_INTERFACE_VERSION_MIN  2
 #define XENBUS_STORE_INTERFACE_VERSION_MAX  2
 
 #endif  // _XENBUS_STORE_INTERFACE_H
diff --git a/src/xenvbd.inf b/src/xenvbd.inf
index 0d575c3b0efc..7bec8c3e3e78 100644
--- a/src/xenvbd.inf
+++ b/src/xenvbd.inf
@@ -54,9 +54,9 @@ xenvbd_coinst.dll=0,,
 %Vendor%=Inst,NT@INF_ARCH@
 
 [Inst.NT@INF_ARCH@]
-%XenVbdName%=XenVbd_Inst,XENBUS\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_VBD&REV_09000007
-%XenVbdName%=XenVbd_Inst,XENBUS\VEN_@VENDOR_PREFIX@0001&DEV_VBD&REV_09000007
-%XenVbdName%=XenVbd_Inst,XENBUS\VEN_@VENDOR_PREFIX@0002&DEV_VBD&REV_09000007
+%XenVbdName%=XenVbd_Inst,XENBUS\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_VBD&REV_09000009
+%XenVbdName%=XenVbd_Inst,XENBUS\VEN_@VENDOR_PREFIX@0001&DEV_VBD&REV_09000009
+%XenVbdName%=XenVbd_Inst,XENBUS\VEN_@VENDOR_PREFIX@0002&DEV_VBD&REV_09000009
 
 [XenVbd_Inst] 
 CopyFiles=XenVbd_Copyfiles
diff --git a/src/xenvbd/adapter.c b/src/xenvbd/adapter.c
index 941587af3494..67dd14c6efc2 100644
--- a/src/xenvbd/adapter.c
+++ b/src/xenvbd/adapter.c
@@ -1382,6 +1382,7 @@ AdapterInitialize(
                           "vbd_bounce",
                           sizeof(XENVBD_BOUNCE),
                           32,
+                          0,
                           AdapterBounceCtor,
                           AdapterBounceDtor,
                           AdapterAcquireLock,
diff --git a/src/xenvbd/granter.c b/src/xenvbd/granter.c
index e09c116ac665..afb29bc3e81c 100644
--- a/src/xenvbd/granter.c
+++ b/src/xenvbd/granter.c
@@ -198,6 +198,7 @@ GranterConnect(
                            &Granter->GnttabInterface,
                            Name,
                            0,
+                           0,
                            GranterAcquireLock,
                            GranterReleaseLock,
                            Granter,
diff --git a/src/xenvbd/ring.c b/src/xenvbd/ring.c
index 07aa841274ad..bfe62a822c27 100644
--- a/src/xenvbd/ring.c
+++ b/src/xenvbd/ring.c
@@ -1772,6 +1772,7 @@ BlkifRingCreate(
                           Name,
                           sizeof(XENVBD_REQUEST),
                           0,
+                          0,
                           BlkifRingRequestCtor,
                           BlkifRingRequestDtor,
                           BlkifRingAcquireLock,
@@ -1794,6 +1795,7 @@ BlkifRingCreate(
                           Name,
                           sizeof(XENVBD_SEGMENT),
                           0,
+                          0,
                           BlkifRingSegmentCtor,
                           BlkifRingSegmentDtor,
                           BlkifRingAcquireLock,
@@ -1816,6 +1818,7 @@ BlkifRingCreate(
                           Name,
                           sizeof(XENVBD_INDIRECT),
                           0,
+                          0,
                           BlkifRingIndirectCtor,
                           BlkifRingIndirectDtor,
                           BlkifRingAcquireLock,
-- 
2.17.1




 


Rackspace

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