mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
When xc_linux_build fails without a meaninful errno, force errno to EINVAL
avoid message "Error creating domain: (0, 'Error')" in the case domU version is too old or too new. Signed-off-by: Vincent Hanquez <vincent@xensource.com>
This commit is contained in:
1 parent
db170676e2
commit
cfb205ce16
1 file changed
+4
-2
@@ -347,9 +347,11 @@ static PyObject *pyxc_linux_build(XcObject *self,
|
||||
if ( xc_linux_build(self->xc_handle, dom, image,
|
||||
ramdisk, cmdline, flags,
|
||||
store_evtchn, &store_mfn,
|
||||
console_evtchn, &console_mfn) != 0 )
|
||||
console_evtchn, &console_mfn) != 0 ) {
|
||||
if (!errno)
|
||||
errno = EINVAL;
|
||||
return PyErr_SetFromErrno(xc_error);
|
||||
|
||||
}
|
||||
return Py_BuildValue("{s:i,s:i}",
|
||||
"store_mfn", store_mfn,
|
||||
"console_mfn", console_mfn);
|
||||
|
||||