]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
vz: remove error logging from prlsdkUUIDParse
authorMaxim Nestratov <mnestratov@virtuozzo.com>
Mon, 21 Sep 2015 11:08:41 +0000 (14:08 +0300)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 21 Sep 2015 11:56:12 +0000 (13:56 +0200)
As far as not every call of prlsdkUUIDParse assume correct UUID
supplied, there is no use to complain about wrong format in it.
Otherwise our log is flooded with false error messages.
For instance, calling prlsdkUUIDParse from prlsdkEventsHandler
works as a filter and in case of uuid absence for event issuer,
we simply know that we shouldn't continue further processing.
Instead of error logging for all calls we should explicitly take
into accaunt where it is called from.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/vz/vz_sdk.c

index 744b58a229c57065ce83db422ae4967d3fd08b24..58c77abc88ebf5bd89ae6cac89e9aa5fdcfdade4 100644 (file)
@@ -328,12 +328,8 @@ prlsdkUUIDParse(const char *uuidstr, unsigned char *uuid)
     tmp[strlen(tmp) - 1] = '\0';
 
     /* trim curly braces */
-    if (virUUIDParse(tmp + 1, uuid) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("UUID in config file malformed"));
-        ret = -1;
+    if (virUUIDParse(tmp + 1, uuid) < 0)
         goto error;
-    }
 
     ret = 0;
  error:
@@ -365,8 +361,11 @@ prlsdkGetDomainIds(PRL_HANDLE sdkdom,
     PrlVmCfg_GetUuid(sdkdom, uuidstr, &len);
     prlsdkCheckRetGoto(pret, error);
 
-    if (prlsdkUUIDParse(uuidstr, uuid) < 0)
+    if (prlsdkUUIDParse(uuidstr, uuid) < 0) {
+        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                       _("Domain UUID is malformed or empty"));
         goto error;
+    }
 
     return 0;
 
@@ -1724,8 +1723,10 @@ prlsdkEventsHandler(PRL_HANDLE prlEvent, PRL_VOID_PTR opaque)
     pret = PrlEvent_GetType(prlEvent, &prlEventType);
     prlsdkCheckRetGoto(pret, cleanup);
 
-    if (prlsdkUUIDParse(uuidstr, uuid) < 0)
+    if (prlsdkUUIDParse(uuidstr, uuid) < 0) {
+        VIR_DEBUG("Skipping event type %d", prlEventType);
         goto cleanup;
+    }
 
     switch (prlEventType) {
     case PET_DSP_EVT_VM_STATE_CHANGED: