Skip to content

Commit b5b154b

Browse files
author
Github action on xapi-project/xen-api
committed
1 parent 2bb0573 commit b5b154b

2 files changed

Lines changed: 99 additions & 13 deletions

File tree

source/includes/datapath.html.md

Lines changed: 95 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ A description of which Xen block backend to use. The toolstack needs this to set
112112
Name | Type | Description
113113
-----------------|---------------------|----------------------------------------
114114
implementations | implementation list | Choice of implementation technologies.
115+
### sock_path
116+
```json
117+
"sock_path"
118+
```
119+
type `sock_path` = `string`
120+
Path to a UNIX domain socket
115121
### uri
116122
```json
117123
"uri"
@@ -510,6 +516,86 @@ class Datapath_myimplementation(Datapath_skeleton):
510516
dbg | in | string | Debug context from the caller
511517
uri | in | uri | A URI which represents how to access the volume disk data.
512518
domain | in | domain | An opaque string which represents the Xen domain.
519+
## Method: `import_activate`
520+
\[import\_activate uri domain\] prepares a connection to the storage named by \[uri\] for use by inbound import mirroring, the \[domain\] parameter identifies which domain to connect to, most likely 0 or a custom storage domain. The return value is a path to a UNIX domain socket to which an open file descriptor may be passed, by SCM\_RIGHTS. This, in turn, will become the server end of a Network Block Device \(NBD\) connection using, new-fixed protocol. Implementations shall declare the VDI\_MIRROR\_IN feature for this method to be supported. It is expected that activate will have been previously called so that there is an active datapath.
521+
522+
> Client
523+
524+
```json
525+
{
526+
"method": "Datapath.import_activate",
527+
"params": [ { "domain": "domain", "uri": "uri", "dbg": "dbg" } ],
528+
"id": 35
529+
}
530+
```
531+
532+
```ocaml
533+
try
534+
let sock_path = Client.import_activate dbg uri domain in
535+
...
536+
with Exn (Unimplemented str) -> ...
537+
538+
```
539+
540+
```python
541+
542+
# import necessary libraries if needed
543+
# we assume that your library providing the client is called myclient and it provides a connect method
544+
import myclient
545+
546+
if __name__ == "__main__":
547+
c = myclient.connect()
548+
results = c.Datapath.import_activate({ dbg: "string", uri: "string", domain: "string" })
549+
print(repr(results))
550+
```
551+
552+
> Server
553+
554+
```json
555+
"sock_path"
556+
```
557+
558+
```ocaml
559+
try
560+
let sock_path = Client.import_activate dbg uri domain in
561+
...
562+
with Exn (Unimplemented str) -> ...
563+
564+
```
565+
566+
```python
567+
568+
# import additional libraries if needed
569+
570+
class Datapath_myimplementation(Datapath_skeleton):
571+
# by default each method will return a Not_implemented error
572+
# ...
573+
574+
def import_activate(self, dbg, uri, domain):
575+
"""
576+
[import_activate uri domain] prepares a connection to the
577+
storage named by [uri] for use by inbound import mirroring,
578+
the [domain] parameter identifies which domain to connect to,
579+
most likely 0 or a custom storage domain. The return value is a
580+
path to a UNIX domain socket to which an open file descriptor
581+
may be passed, by SCM_RIGHTS. This, in turn, will become
582+
the server end of a Network Block Device (NBD) connection
583+
using, new-fixed protocol. Implementations shall declare the
584+
VDI_MIRROR_IN feature for this method to be supported. It is
585+
expected that activate will have been previously called so that
586+
there is an active datapath.
587+
"""
588+
return "string"
589+
# ...
590+
```
591+
592+
593+
Name | Direction | Type | Description
594+
-----------|-----------|-----------|------------------------------------------------------------
595+
dbg | in | string | Debug context from the caller
596+
uri | in | uri | A URI which represents how to access the volume disk data.
597+
domain | in | domain | An opaque string which represents the Xen domain.
598+
sock_path | out | sock_path | A path to a UNIX domain socket in the filesystem.
513599
## Method: `deactivate`
514600
\[deactivate uri domain\] is called as soon as a VM has finished reading or writing its disk. This is an opportunity for an implementation which needs to perform an explicit volume handover to do it. This function is called in the migration downtime window so delays here will be noticeable to users and should be minimised. This function is idempotent.
515601

@@ -519,7 +605,7 @@ class Datapath_myimplementation(Datapath_skeleton):
519605
{
520606
"method": "Datapath.deactivate",
521607
"params": [ { "domain": "domain", "uri": "uri", "dbg": "dbg" } ],
522-
"id": 35
608+
"id": 36
523609
}
524610
```
525611

@@ -591,7 +677,7 @@ class Datapath_myimplementation(Datapath_skeleton):
591677
{
592678
"method": "Datapath.detach",
593679
"params": [ { "domain": "domain", "uri": "uri", "dbg": "dbg" } ],
594-
"id": 36
680+
"id": 37
595681
}
596682
```
597683

@@ -666,7 +752,7 @@ class Datapath_myimplementation(Datapath_skeleton):
666752
{
667753
"method": "Datapath.close",
668754
"params": [ { "uri": "uri", "dbg": "dbg" } ],
669-
"id": 37
755+
"id": 38
670756
}
671757
```
672758

@@ -783,7 +869,7 @@ To mirror a VDI a sequence of these API calls is required:
783869
"dbg": "dbg"
784870
}
785871
],
786-
"id": 38
872+
"id": 39
787873
}
788874
```
789875

@@ -863,7 +949,7 @@ class Data_myimplementation(Data_skeleton):
863949
"params": [
864950
{ "remote": "remote", "domain": "domain", "uri": "uri", "dbg": "dbg" }
865951
],
866-
"id": 39
952+
"id": 40
867953
}
868954
```
869955

@@ -938,7 +1024,7 @@ class Data_myimplementation(Data_skeleton):
9381024
"params": [
9391025
{ "operation": [ "Copy", [ "Copy_1", "Copy_2" ] ], "dbg": "dbg" }
9401026
],
941-
"id": 40
1027+
"id": 41
9421028
}
9431029
```
9441030

@@ -1010,7 +1096,7 @@ class Data_myimplementation(Data_skeleton):
10101096
"params": [
10111097
{ "operation": [ "Copy", [ "Copy_1", "Copy_2" ] ], "dbg": "dbg" }
10121098
],
1013-
"id": 41
1099+
"id": 42
10141100
}
10151101
```
10161102

@@ -1080,7 +1166,7 @@ class Data_myimplementation(Data_skeleton):
10801166
"params": [
10811167
{ "operation": [ "Copy", [ "Copy_1", "Copy_2" ] ], "dbg": "dbg" }
10821168
],
1083-
"id": 42
1169+
"id": 43
10841170
}
10851171
```
10861172

@@ -1146,7 +1232,7 @@ class Data_myimplementation(Data_skeleton):
11461232
> Client
11471233
11481234
```json
1149-
{ "method": "Data.ls", "params": [ { "dbg": "dbg" } ], "id": 43 }
1235+
{ "method": "Data.ls", "params": [ { "dbg": "dbg" } ], "id": 44 }
11501236
```
11511237

11521238
```ocaml

source/includes/task.html.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ The task interface is for querying the status of asynchronous tasks. All long-r
154154
{
155155
"method": "Task.stat",
156156
"params": [ { "id": "id", "dbg": "dbg" } ],
157-
"id": 44
157+
"id": 45
158158
}
159159
```
160160

@@ -228,7 +228,7 @@ class Task_myimplementation(Task_skeleton):
228228
{
229229
"method": "Task.cancel",
230230
"params": [ { "id": "id", "dbg": "dbg" } ],
231-
"id": 45
231+
"id": 46
232232
}
233233
```
234234

@@ -299,7 +299,7 @@ class Task_myimplementation(Task_skeleton):
299299
{
300300
"method": "Task.destroy",
301301
"params": [ { "id": "id", "dbg": "dbg" } ],
302-
"id": 46
302+
"id": 47
303303
}
304304
```
305305

@@ -364,7 +364,7 @@ class Task_myimplementation(Task_skeleton):
364364
> Client
365365
366366
```json
367-
{ "method": "Task.ls", "params": [ { "dbg": "dbg" } ], "id": 47 }
367+
{ "method": "Task.ls", "params": [ { "dbg": "dbg" } ], "id": 48 }
368368
```
369369

370370
```ocaml

0 commit comments

Comments
 (0)