mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
libxl: convert libxl_domain_destroy to an async op
This change introduces some new structures, and breaks the mutual dependency that libxl_domain_destroy and libxl__destroy_device_model had. This is done by checking if the domid passed to libxl_domain_destroy has a stubdom, and then having the bulk of the destroy machinery in a separate function (libxl__destroy_domid) that doesn't check for stubdom presence, since we check for it in the upper level function. The reason behind this change is the need to use structures for ao operations, and it was impossible to have two different self-referencing structs. All uses of libxl_domain_destroy have been changed, and either replaced by the new libxl_domain_destroy ao function or by the internal libxl__domain_destroy that can be used inside an already running ao. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
1 parent
9770c75ba3
commit
225b2010db
8 files changed
+489
-85
No files matched your search
@@ -437,7 +437,7 @@ static PyObject *pyxl_domain_destroy(XlObject *self, PyObject *args)
|
||||
int domid;
|
||||
if ( !PyArg_ParseTuple(args, "i", &domid) )
|
||||
return NULL;
|
||||
if ( libxl_domain_destroy(self->ctx, domid) ) {
|
||||
if ( libxl_domain_destroy(self->ctx, domid, 0) ) {
|
||||
PyErr_SetString(xl_error_obj, "cannot destroy domain");
|
||||
return NULL;
|
||||
}
|
||||
|
||||