put libvirt debug behind a flag

only turn on the libvirt debugging if we really need it, which
we could control in the gate via devstack-gate.

Change-Id: I5e6d41d5333357608ab6a614610c060400f70a10
This commit is contained in:
Sean Dague 2014-03-11 16:38:57 -04:00
parent efad7911a4
commit dd304603e0

View File

@ -25,6 +25,8 @@ set +o xtrace
# File injection is disabled by default in Nova. This will turn it back on.
ENABLE_FILE_INJECTION=${ENABLE_FILE_INJECTION:-False}
# if we should turn on massive libvirt debugging
DEBUG_LIBVIRT=$(trueorfalse False $DEBUG_LIBVIRT)
# Entry Points
@ -104,6 +106,7 @@ EOF
add_user_to_group $STACK_USER $LIBVIRT_GROUP
# Enable server side traces for libvirtd
if [[ "$DEBUG_LIBVIRT" = "True" ]] ; then
local log_filters="1:libvirt 1:qemu 1:conf 1:security 3:event 3:json 3:file 1:util"
local log_outputs="1:file:/var/log/libvirt/libvirtd.log"
if ! grep -q "log_filters=\"$log_filters\"" /etc/libvirt/libvirtd.conf; then
@ -112,6 +115,7 @@ EOF
if ! grep -q "log_outputs=\"$log_outputs\"" /etc/libvirt/libvirtd.conf; then
echo "log_outputs=\"$log_outputs\"" | sudo tee -a /etc/libvirt/libvirtd.conf
fi
fi
# libvirt detects various settings on startup, as we potentially changed
# the system configuration (modules, filesystems), we need to restart