From: Nick Rosbrook Date: Mon, 24 May 2021 20:36:50 +0000 (-0400) Subject: golang/xenlight: add DomainDestroy wrapper X-Git-Tag: archive/raspbian/4.16.0+51-g0941d6cb-1+rpi1~2^2~42^2~418 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9b6d865e0af56e376740ba03b1ccdf316362a71e;p=xen.git golang/xenlight: add DomainDestroy wrapper Add a wrapper around libxl_domain_destroy. Signed-off-by: Nick Rosbrook Reviewed-by: George Dunlap --- diff --git a/tools/golang/xenlight/xenlight.go b/tools/golang/xenlight/xenlight.go index fc3eb0bf3f..f605f17613 100644 --- a/tools/golang/xenlight/xenlight.go +++ b/tools/golang/xenlight/xenlight.go @@ -1272,3 +1272,13 @@ func (ctx *Context) DomainCreateNew(config *DomainConfig) (Domid, error) { return Domid(cdomid), nil } + +// DomainDestroy destroys a domain given a domid. +func (ctx *Context) DomainDestroy(domid Domid) error { + ret := C.libxl_domain_destroy(ctx.ctx, C.uint32_t(domid), nil) + if ret != 0 { + return Error(ret) + } + + return nil +}