提交 15770695 编写于 作者: C Cole Robinson

qemu: Improve some qemu.conf error reporting

Log some info if we can't find a config file. Make parse failures
fatal, and actually raise an error message.
上级 e190754e
...@@ -133,16 +133,21 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, ...@@ -133,16 +133,21 @@ int qemudLoadDriverConfig(struct qemud_driver *driver,
/* Just check the file is readable before opening it, otherwise /* Just check the file is readable before opening it, otherwise
* libvirt emits an error. * libvirt emits an error.
*/ */
if (access (filename, R_OK) == -1) return 0; if (access (filename, R_OK) == -1) {
VIR_INFO("Could not read qemu config file %s", filename);
return 0;
}
conf = virConfReadFile (filename, 0); conf = virConfReadFile (filename, 0);
if (!conf) return 0; if (!conf) {
return -1;
}
#define CHECK_TYPE(name,typ) if (p && p->type != (typ)) { \ #define CHECK_TYPE(name,typ) if (p && p->type != (typ)) { \
qemuReportError(VIR_ERR_INTERNAL_ERROR, \ qemuReportError(VIR_ERR_INTERNAL_ERROR, \
"remoteReadConfigFile: %s: %s: expected type " #typ, \ "%s: %s: expected type " #typ, \
filename, (name)); \ filename, (name)); \
virConfFree(conf); \ virConfFree(conf); \
return -1; \ return -1; \
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册