mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
libxl: make libxl_device_pci_{add,remove,destroy} interfaces asynchronous
This does not make the implementation fully asynchronous but just updates the API to support asynchrony in the future. Currently although these functions do not call hotplug scripts etc and therefore are not "slow" (per the comment about ao machinery in libxl_internal.h) they do interact with the device model and so are not quite "fast" either. We can live with this for now. Signed-off-by: Ian Campbell <ian.campbell@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
e50c91ab1a
commit
6e6a6f3614
5 files changed
+46
-29
No files matched your search
@@ -497,7 +497,7 @@ static PyObject *pyxl_pci_add(XlObject *self, PyObject *args)
|
||||
return NULL;
|
||||
}
|
||||
pci = (Py_device_pci *)obj;
|
||||
if ( libxl_device_pci_add(self->ctx, domid, &pci->obj) ) {
|
||||
if ( libxl_device_pci_add(self->ctx, domid, &pci->obj, 0) ) {
|
||||
PyErr_SetString(xl_error_obj, "cannot add pci device");
|
||||
return NULL;
|
||||
}
|
||||
@@ -519,12 +519,12 @@ static PyObject *pyxl_pci_del(XlObject *self, PyObject *args)
|
||||
}
|
||||
pci = (Py_device_pci *)obj;
|
||||
if ( force ) {
|
||||
if ( libxl_device_pci_destroy(self->ctx, domid, &pci->obj) ) {
|
||||
if ( libxl_device_pci_destroy(self->ctx, domid, &pci->obj, 0) ) {
|
||||
PyErr_SetString(xl_error_obj, "cannot remove pci device");
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
if ( libxl_device_pci_remove(self->ctx, domid, &pci->obj) ) {
|
||||
if ( libxl_device_pci_remove(self->ctx, domid, &pci->obj, 0) ) {
|
||||
PyErr_SetString(xl_error_obj, "cannot remove pci device");
|
||||
return NULL;
|
||||
}
|
||||
|
||||