[functional-tests] (device-mapper targets)

This commit is contained in:
Joe Thornber
2017-10-06 15:26:10 +01:00
parent f80200d179
commit d9b3133aca
4 changed files with 49 additions and 6 deletions

View File

@@ -194,11 +194,15 @@
(map foreign-free acc)
(loop (ftype-ref Target (next) t) (cons t acc)))))
;; targets should be dlambdas with 'size, 'type and 'format methods
(define (load-table dm name targets)
(define load
(foreign-procedure "dm_load" ((* DMIoctlInterface) string (* Target)) int))
(let* ((ctargets (build-c-targets targets))
(define (dlambda->target t)
(make-target (t 'size) (t 'type) (t 'format)))
(let* ((ctargets (build-c-targets (map dlambda->target targets)))
(r (load dm name ctargets)))
(free-c-targets ctargets)
(unless (zero? r)