Skip to content

Commit

Permalink
Add kalray plugin to configure DPU
Browse files Browse the repository at this point in the history
- Work is in progress...
  - Just create the skeleton
  • Loading branch information
gthvn1 committed Sep 11, 2023
1 parent 31357d8 commit 4776667
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions SOURCES/etc/xapi.d/plugins/kalray-dpu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/python

import XenAPIPlugin

from xcpngutils import error_wrapped

# Usage example:
# xe host-call-plugin \
# host-uuid=ffa19733-267f-4311-8b5f-01e62011b646 \
# plugin=kalray-dpu.py \
# fn=create_raid \
# args:data="hello, world"

@error_wrapped
def create_raid(session, args):
try:
data = args["data"]
return data[::-1]
except KeyError:
raise RuntimeError("No argument found with key 'data'.")

@error_wrapped
def create_lvs(session, args):
try:
data = args["data"]
return data[::-1]
except KeyError:
raise RuntimeError("No argument found with key 'data'.")

@error_wrapped
def create_lvol(session, args):
try:
data = args["data"]
return data[::-1]
except KeyError:
raise RuntimeError("No argument found with key 'data'.")

if __name__ == "__main__":
XenAPIPlugin.dispatch({
"create_raid": create_raid,
"create_lvs": create_lvs,
"create_lvol": create_lvol,
})

0 comments on commit 4776667

Please sign in to comment.