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

[PATCH] Add log to Xenfilt DriverAddDevice


  • To: <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Martin Harvey <Martin.Harvey@xxxxxxxxxx>
  • Date: Wed, 7 Jul 2021 09:54:53 +0100
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Owen Smith <owen.smith@xxxxxxxxxx>
  • Delivery-date: Wed, 07 Jul 2021 08:55:20 +0000
  • Ironport-hdrordr: A9a23:zPFGI6oT1HmJ8rOkoe4GVMoaV5oReYIsimQD101hICG8cqSj9v xG+85rrCMc6QxhI03I9urwW5VoLUmyyXcx2/h0AV7AZniBhILLFvAB0WKK+VSJcEeSmtK1l5 0QFJSWYOeAdWSS5vyb3ODXKbgdKaG8gcWVuds=
  • Ironport-sdr: cQDHH54hIR+mONzay0zf2eLcHaEFs4DVZ670TIiyygitFn4sNyFr+lB9bldrgRHUmqxTUefGp7 1+VkBkR5y/3UzyV3dnV1l8GciVO4GbIRfe3ZVH+LqPaAGp9bC0pTrx7+tiXjeILFof0gDuOuuW e7iZNWtuX/RM4vxtRIvN4iA/a9Y3vpOYsRpNce1xxAZtD2l2R+cLDZO4e5YhAh2PF61/66ivuI 1qceNB7is7y0k/0uvh4T5HFi0ef5IvWgqb7mfzkjYKdD8d+eZeMgIDIjO/x3Bu9hEpBIkwchCb gww=
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

From: Owen Smith <owen.smith@xxxxxxxxxx>

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

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;
-- 
2.28.0.windows.1




 


Rackspace

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