]> xenbits.xensource.com Git - libvirt.git/commitdiff
libxl: Add debug statements
authorJim Fehlig <jfehlig@suse.com>
Tue, 13 Apr 2021 23:29:19 +0000 (17:29 -0600)
committerJim Fehlig <jfehlig@suse.com>
Wed, 14 Apr 2021 16:10:26 +0000 (10:10 -0600)
Over several years of debugging reports related to VM shutdown, destruction,
and cleanup, I've found that logging of all events received from libxl and
logging the entry of libxlDomainCleanup has proven useful. Add the these
debug messages upstream to aid in future debugging.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/libxl/libxl_domain.c

index a25d65629a4c8ef953a943ee3410478c24bc09e2..917f6f1d810412985549f05448d2ce86d1590db5 100644 (file)
@@ -648,6 +648,8 @@ libxlDomainEventHandler(void *data, VIR_LIBXL_EVENT_CONST libxl_event *event)
     virDomainObj *vm = NULL;
     g_autoptr(libxlDriverConfig) cfg = NULL;
 
+    VIR_DEBUG("Received libxl event '%d' for domid '%d'", event->type, event->domid);
+
     if (event->type != LIBXL_EVENT_TYPE_DOMAIN_SHUTDOWN &&
             event->type != LIBXL_EVENT_TYPE_DOMAIN_DEATH) {
         VIR_INFO("Unhandled event type %d", event->type);
@@ -844,6 +846,9 @@ libxlDomainCleanup(libxlDriverPrivate *driver,
     unsigned int hostdev_flags = VIR_HOSTDEV_SP_PCI;
     g_autoptr(virConnect) conn = NULL;
 
+    VIR_DEBUG("Cleaning up domain with id '%d' and name '%s'",
+              vm->def->id, vm->def->name);
+
 #ifdef LIBXL_HAVE_PVUSB
     hostdev_flags |= VIR_HOSTDEV_SP_USB;
 #endif