[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH v2 4/5] Remove incorrectly used TODO macro



On 07/05/2017 05:58 AM, Daniel P. Berrange wrote:
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>
---
  src/internal.h           | 9 ---------
  src/xen/xen_hypervisor.c | 6 ++++--
  src/xen/xend_internal.c  | 6 ++++--
  3 files changed, 8 insertions(+), 13 deletions(-)

I responded to your V1 before seeing V2. ACK stands...

Regards,
Jim


diff --git a/src/internal.h b/src/internal.h
index 2b8cc09..c29f20f 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -244,15 +244,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:
   *
   * In place exchange of two values
diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index bce7b56..e18a472 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -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));
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index 605c3cd..6da2950 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -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];



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]