提交 1dbbcb62 编写于 作者: D Daniel P. Berrange

Remove incorrectly used TODO macro

The TODO macro expands to an fprintf() call and is used in several
places in the Xen driver. Anything that wishes to print such debug
messages should use the logging macros. In this case though, all the
places in the Xen driver should have been raising a formal libvirt
error instead. Add proper error handling and delete the TODO macro
to prevent future misuse.
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 d8f8c7a8
......@@ -243,15 +243,6 @@
*/
# define EMPTYSTR(s) ((s) ? (s) : "-")
/**
* TODO:
*
* macro to flag unimplemented blocks
*/
# define TODO \
fprintf(stderr, "Unimplemented block at %s:%d\n", \
__FILE__, __LINE__);
/**
* SWAP:
*
......
......@@ -1262,7 +1262,8 @@ xenHypervisorGetSchedulerParameters(virConnectPtr conn,
}
/* TODO: Implement for Xen/SEDF */
TODO
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("SEDF schedular parameters not supported"));
return -1;
case XEN_SCHEDULER_CREDIT:
memset(&op_dom, 0, sizeof(op_dom));
......@@ -1359,7 +1360,8 @@ xenHypervisorSetSchedulerParameters(virConnectPtr conn,
switch (op_sys.u.getschedulerid.sched_id) {
case XEN_SCHEDULER_SEDF:
/* TODO: Implement for Xen/SEDF */
TODO
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("SEDF schedular parameters not supported"));
return -1;
case XEN_SCHEDULER_CREDIT: {
memset(&op_dom, 0, sizeof(op_dom));
......
......@@ -2881,7 +2881,8 @@ xenDaemonGetSchedulerParameters(virConnectPtr conn,
}
/* TODO: Implement for Xen/SEDF */
TODO
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("SEDF schedular parameters not supported"));
goto error;
case XEN_SCHED_CRED_NPARAM:
/* get cpu_weight/cpu_cap from xend/domain */
......@@ -2972,7 +2973,8 @@ xenDaemonSetSchedulerParameters(virConnectPtr conn,
switch (sched_nparam) {
case XEN_SCHED_SEDF_NPARAM:
/* TODO: Implement for Xen/SEDF */
TODO
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("SEDF schedular parameters not supported"));
goto error;
case XEN_SCHED_CRED_NPARAM: {
char buf_weight[VIR_UUID_BUFLEN];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册