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:
vhanquez@kneesa.uk.xensource.com committed 2006-02-16 16:19:38 +00:00
1 parent db170676e2
commit cfb205ce16
1 file changed
+4 -2
+4 -2
View File
@@ -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);
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.