]> xenbits.xensource.com Git - pvdrivers/win/xeniface.git/commitdiff
Reduce log spam
authorOwen Smith <owen.smith@citrix.com>
Thu, 21 Apr 2022 12:29:45 +0000 (13:29 +0100)
committerPaul Durrant <pdurrant@amazon.com>
Mon, 25 Apr 2022 08:32:14 +0000 (09:32 +0100)
Squash errors generated by IoctlDirectory returning no sub-paths
Reduce logging level in ThreadCreate

Signed-off-by: Owen Smith <owen.smith@citrix.com>
src/xeniface/ioctl_store.c
src/xeniface/thread.c

index 9116e82bdcf550401499a6ba2018345d738f84a3..97062df4d2502153b6e7402a1dcc7b5c71c3f19c 100644 (file)
@@ -218,6 +218,7 @@ IoctlStoreDirectory(
     PCHAR       Value;
     ULONG       Length;
     ULONG       Count;
+    BOOLEAN     SquashError = FALSE;
 
     status = STATUS_INVALID_BUFFER_SIZE;
     if (InLen == 0)
@@ -228,14 +229,17 @@ IoctlStoreDirectory(
         goto fail2;
 
     status = XENBUS_STORE(Directory, &Fdo->StoreInterface, NULL, NULL, Buffer, &Value);
-    if (!NT_SUCCESS(status))
+    if (!NT_SUCCESS(status)) {
+        if (status == STATUS_OBJECT_NAME_NOT_FOUND)
+            SquashError = TRUE;
         goto fail3;
+    }
 
     Length = __MultiSzLen(Value, &Count) + 1;
 
     status = STATUS_BUFFER_OVERFLOW;
     if (OutLen == 0) {
-        Trace("(\"%s\")=(%d)(%d)\n", Buffer, Length, Count);
+        Trace("(\"%s\")=(%d bytes)(%d items)\n", Buffer, Length, Count);
         goto done;
     }
 
@@ -243,7 +247,7 @@ IoctlStoreDirectory(
     if (OutLen < Length)
         goto fail4;
 
-    Info("(\"%s\")=(%d)(%d)\n", Buffer, Length, Count);
+    Trace("(\"%s\")=(%d bytes)(%d items)\n", Buffer, Length, Count);
 #if DBG
     __DisplayMultiSz(Value);
 #endif
@@ -262,11 +266,14 @@ fail4:
     Error("Fail4 (\"%s\")=(%d < %d)\n", Buffer, OutLen, Length);
     XENBUS_STORE(Free, &Fdo->StoreInterface, Value);
 fail3:
-    Error("Fail3 (\"%s\")\n", Buffer);
+    if (!SquashError)
+        Error("Fail3 (\"%s\")\n", Buffer);
 fail2:
-    Error("Fail2\n");
+    if (!SquashError)
+        Error("Fail2\n");
 fail1:
-    Error("Fail1 (%08x)\n", status);
+    if (!SquashError)
+        Error("Fail1 (%08x)\n", status);
     return status;
 }
 
@@ -310,7 +317,7 @@ PXENBUS_STORE_PERMISSION
 __ConvertPermissions(
     __in  ULONG                       NumberPermissions,
     __in  PXENIFACE_STORE_PERMISSION  XenifacePermissions
-)
+    )
 {
     PXENBUS_STORE_PERMISSION          XenbusPermissions;
     ULONG                             Index;
@@ -411,7 +418,9 @@ IoctlStoreSetPermissions(
 
     for (Index = 0; Index < In->NumberPermissions; Index++) {
         Trace("> %lu: Domain %d, Mask 0x%x\n",
-                           Index, Permissions[Index].Domain, Permissions[Index].Mask);
+              Index,
+              Permissions[Index].Domain,
+              Permissions[Index].Mask);
     }
 
     status = XENBUS_STORE(PermissionsSet,
index 4a5d425f62573faca214aff650540b04c99f3950..4d767a04f5995972b1a41424d2c984d185f8266d 100644 (file)
@@ -130,7 +130,7 @@ ThreadCreate(
 
     (*Thread) = __ThreadAllocate(sizeof (XENIFACE_THREAD));
 
-    Warning("Create thread %p %p\n", Function, Thread);
+    Trace("Create thread %p %p\n", Function, Thread);
 
     status = STATUS_NO_MEMORY;
     if (*Thread == NULL)