mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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:
1 parent
c089de0e2f
commit
9b6d865e0a
1 file changed
+10
@@ -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
|
||||
}
|
||||