Re: [PATCH 06/23] Replace use of openvzError with virReportError

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

 



On 07/18/12 20:40, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

Update the OpenVZ driver to use virReportError instead of
the openvzError custom macro

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
  cfg.mk                     |    1 -
  src/openvz/openvz_conf.c   |  132 ++++++++++-----------
  src/openvz/openvz_conf.h   |    4 -
  src/openvz/openvz_driver.c |  282 ++++++++++++++++++++++----------------------
  src/openvz/openvz_util.c   |    5 +-
  5 files changed, 211 insertions(+), 213 deletions(-)


...

  /* OpenVZ commands - Replace with wrapper scripts later? */
  # define VZLIST  "/usr/sbin/vzlist"
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index 8ecd83b..8f923dc 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c

...

@@ -1371,21 +1373,21 @@ static virDrvOpenStatus openvzOpen(virConnectPtr conn,
          /* If path isn't /system, then they typoed, so tell them correct path */
          if (conn->uri->path == NULL ||
              STRNEQ (conn->uri->path, "/system")) {
-            openvzError(VIR_ERR_INTERNAL_ERROR,
-                        _("unexpected OpenVZ URI path '%s', try openvz:///system"),
+            virReportError(VIR_ERR_INTERNAL_ERROR,
+                           _("unexpected OpenVZ URI path '%s', try openvz:///system"),
                          conn->uri->path);

Bad indent on the last parameter.

              return VIR_DRV_OPEN_ERROR;
          }

          if (!virFileExists("/proc/vz")) {
-            openvzError(VIR_ERR_INTERNAL_ERROR, "%s",
-                        _("OpenVZ control file /proc/vz does not exist"));
+            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                           _("OpenVZ control file /proc/vz does not exist"));
              return VIR_DRV_OPEN_ERROR;
          }

          if (access("/proc/vz", W_OK) < 0) {
-            openvzError(VIR_ERR_INTERNAL_ERROR, "%s",
-                        _("OpenVZ control file /proc/vz is not accessible"));
+            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                           _("OpenVZ control file /proc/vz is not accessible"));
              return VIR_DRV_OPEN_ERROR;
          }
      }

ACK with the one nit fixed.

Peter

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]