golang/xenlight: add DomainDestroy wrapper

Add a wrapper around libxl_domain_destroy.

Signed-off-by: Nick Rosbrook <rosbrookn@ainfosec.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
This commit is contained in:
Nick Rosbrook authored and George Dunlap committed 2021-06-21 16:49:08 +01:00
1 parent c089de0e2f
commit 9b6d865e0a
1 file changed
+10
+10
View File
@@ -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
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.