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

Re: [PATCH] Add log to Xenfilt DriverAddDevice


  • To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Paul Durrant <xadimgnik@xxxxxxxxx>
  • Date: Mon, 12 Jul 2021 20:05:56 +0100
  • Delivery-date: Mon, 12 Jul 2021 19:06:02 +0000
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

On 07/07/2021 09:54, Martin Harvey wrote:
From: Owen Smith <owen.smith@xxxxxxxxxx>

Log all calls to DriverAddDevice, and the type of the device if possible

Any particular reason existent logging is insufficient? I think we need more justification here.

  Paul


Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
  src/xenfilt/driver.c | 17 +++++++++++++++++
  1 file changed, 17 insertions(+)

diff --git a/src/xenfilt/driver.c b/src/xenfilt/driver.c
index 8f14ec8..2c9b54e 100644
--- a/src/xenfilt/driver.c
+++ b/src/xenfilt/driver.c
@@ -724,6 +724,19 @@ fail1:
      return status;
  }
+static FORCEINLINE PCHAR
+__EmulatedTypeName(
+    IN  XENFILT_EMULATED_OBJECT_TYPE    Type
+    )
+{
+    switch (Type) {
+    case XENFILT_EMULATED_OBJECT_TYPE_UNKNOWN:  return "UNKNOWN";
+    case XENFILT_EMULATED_OBJECT_TYPE_PCI:      return "PCI";
+    case XENFILT_EMULATED_OBJECT_TYPE_IDE:      return "IDE";
+    default:                                    return "InvalidType";
+    }
+}
+
  static XENFILT_EMULATED_OBJECT_TYPE
  DriverGetEmulatedType(
      IN  PCHAR                       Id
@@ -805,6 +818,10 @@ DriverAddDevice(
          }
      }
+ Info("%p %s\n",
+         PhysicalDeviceObject,
+         __EmulatedTypeName(Type));
+
      status = STATUS_SUCCESS;
      if (Type == XENFILT_EMULATED_OBJECT_TYPE_UNKNOWN)
          goto done;





 


Rackspace

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