From 07dc2bf7760fa1c5b28d2dd71fb4eebd7a8921f2 Mon Sep 17 00:00:00 2001
From: Kashyap Chamarthy <kchamart@redhat.com>
Date: Wed, 1 Jun 2016 12:21:00 +0200
Subject: [PATCH] functions-libvirt: Add log filter to capture CPU driver
 errors

Two things:

  (a) Add the log filter to capture libvirt CPU manipulation driver
      related error messages when things fallout (e.g. CPU model
      comparision failures during live migration).

  (b) While we're at it, remove the "1:qemu_monitor" log filter, because
      the existing filter "1:qemu" should take care of logging the
      interactions with QEMU monitor console.  This is the case since
      the introduction of VIR_LOG_INIT() macro in upstream libvirt,
      which performs a substring match on a given file name.  (Available
      from libvirt version v1.2.10 onwards).

Change-Id: I75befd52d9f892eb5a6236eee9a397fab7602ecc
---
 lib/nova_plugins/functions-libvirt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/nova_plugins/functions-libvirt b/lib/nova_plugins/functions-libvirt
index dbb4d4fb4b..09723db166 100644
--- a/lib/nova_plugins/functions-libvirt
+++ b/lib/nova_plugins/functions-libvirt
@@ -108,9 +108,9 @@ EOF
             # source file paths, not relative paths. This screws with the matching
             # of '1:libvirt' making everything turn on. So use libvirt.c for now.
             # This will have to be re-visited when Ubuntu ships libvirt >= 1.2.3
-            local log_filters="1:libvirt.c 1:qemu 1:conf 1:security 3:object 3:event 3:json 3:file 1:util 1:qemu_monitor"
+            local log_filters="1:libvirt.c 1:qemu 1:conf 1:security 3:object 3:event 3:json 3:file 1:util 1:cpu"
         else
-            local log_filters="1:libvirt 1:qemu 1:conf 1:security 3:object 3:event 3:json 3:file 1:util 1:qemu_monitor"
+            local log_filters="1:libvirt 1:qemu 1:conf 1:security 3:object 3:event 3:json 3:file 1:util 1:cpu"
         fi
         local log_outputs="1:file:/var/log/libvirt/libvirtd.log"
         if ! sudo grep -q "^log_filters=\"$log_filters\"" /etc/libvirt/libvirtd.conf; then