mirror of https://gitee.com/openkylin/libvirt.git
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: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
d8f8c7a83d
commit
1dbbcb629a
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue