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

[PATCH 5/7] Squash Error when LogLevel value is not present



LogLevel override values are usually not present, and this will reduce logging
which is not required.

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 src/xen/log.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/xen/log.c b/src/xen/log.c
index a65b233..8673105 100644
--- a/src/xen/log.c
+++ b/src/xen/log.c
@@ -744,14 +744,20 @@ LogReadLogLevel(
     PANSI_STRING        Values;
     ULONG               Type;
     ULONG               Index;
+    BOOLEAN             SquashError;
     NTSTATUS            status;
 
+    SquashError = FALSE;
+
     status = RegistryQuerySzValue(Key,
                                   Name,
                                   &Type,
                                   &Values);
-    if (!NT_SUCCESS(status))
+    if (!NT_SUCCESS(status)) {
+        if (status == STATUS_OBJECT_NAME_NOT_FOUND)
+            SquashError = TRUE;
         goto fail1;
+    }
 
     status = STATUS_INVALID_PARAMETER;
     if (Type != REG_MULTI_SZ)
@@ -780,7 +786,8 @@ fail2:
     RegistryFreeSzValue(Values);
 
 fail1:
-    Error("fail1 (%08x)\n", status);
+    if (!SquashError)
+        Error("fail1 (%08x)\n", status);
 
     *LogLevel = LOG_LEVEL_NONE;
 
-- 
2.51.2.windows.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.