[libvirt] [PATCH 13/23] Replace use of ESX_ERROR & ESX_VI_ERROR with virReportError

Michal Privoznik mprivozn at redhat.com
Fri Jul 20 12:18:41 UTC 2012


On 18.07.2012 20:40, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
> 
> Update the ESX driver to use virReportError instead of
> the ESX_ERROR & ESX_VI_ERROR custom macros
> 
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
>  cfg.mk                       |    2 -
>  src/esx/esx_driver.c         |  422 ++++++++++++++--------------
>  src/esx/esx_private.h        |    4 -
>  src/esx/esx_storage_driver.c |  100 +++----
>  src/esx/esx_util.c           |   74 ++---
>  src/esx/esx_vi.c             |  626 +++++++++++++++++++++---------------------
>  src/esx/esx_vi.h             |    7 -
>  src/esx/esx_vi_methods.c     |   12 +-
>  src/esx/esx_vi_types.c       |  216 +++++++--------
>  9 files changed, 725 insertions(+), 738 deletions(-)

ACK with this squashed in:

diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index 86b0c6d..b1b5d70 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -386,8 +386,8 @@ esxVI_CURL_Download(esxVI_CURL *curl, const char *url, char **content,
          * small things such as VMX of VMDK metadata files.
          */
         if (*length > INT32_MAX / 2) {
-            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
-                         _("Download length it too large"));
+            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                           _("Download length it too large"));
             return -1;
         }
 
diff --git a/src/esx/esx_vi_types.c b/src/esx/esx_vi_types.c
index 5a53b42..9e67eff 100644
--- a/src/esx/esx_vi_types.c
+++ b/src/esx/esx_vi_types.c
@@ -1231,7 +1231,7 @@ int
 esxVI_String_Deserialize(xmlNodePtr node, esxVI_String **string)
 {
     if (string == NULL || *string != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
+        virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }


Michal




More information about the libvir-list mailing list