[openstack-dev] [nova][libvirt] Logging interactions of libvirt + QEMU in Nova
Kashyap Chamarthy
kchamart at redhat.com
Wed Feb 4 19:10:25 UTC 2015
On Wed, Feb 04, 2015 at 11:15:18AM -0500, Davanum Srinivas wrote:
> Daniel, Kashyap,
>
> One question that came up on IRC was, how/where to configure say a
> directory where core dumps from qemu would end up. Sean was seeing a
> scenario where he noticed a core dump from qemu in dmesg/syslog
If you're using something similar to ABRT on Ubuntu (assuming you're
using that), you should be able to find the stack traces. Seems like on
Ubuntu, this is what they use
https://wiki.ubuntu.com/Apport
> and > was wondering how to specify a directory to capture a core dump
> if/when it occurs.
Incidentally, last week I was debugging a QEMU seg fault with upstream
folks[1] which involves qemu-nbd.
To capture coredumps with QEMU, this is what I had to do on my Fedora 21
system. Ensure abrt-ccpp (Automatic bug reporting tool is running:
$ systemctl status abrt-ccpp
● abrt-ccpp.service - Install ABRT coredump hook
Loaded: loaded (/usr/lib/systemd/system/abrt-ccpp.service; enabled)
Active: active (exited) since Tue 2015-02-03 16:16:14 CET; 1 day 3h ago
Main PID: 1113 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/abrt-ccpp.service
Then the coredump file should land in:
/var/tmp/abrt/ccpp-2015-01-30-00\:01\:05-3145/
You can actually see that the specific coredump is for QEMU, by running
(note, in this example it was `qemu-img` that was seg faulting - and
there are patches accepted for this upstream):
$ cd /var/tmp/abrt/ccpp-2015-01-30-00\:01\:05-3145/
$ file coredump
coredump: ELF 64-bit LSB core file x86-64, version 1 (SYSV), SVR4-style, from '/home/kashyapc/build/qemu/qemu-img
Assuming you have all the QEMU debug info packages installed, you can
then invoke GDB to capture the trace backs. An example[2]
$ gdb /var/tmp/abrt/ccpp-2015-01-30-00\:01\:05-3145/coredump
[. . .]
(gdb) bt full
[. . .]
[1]
http://lists.nongnu.org/archive/html/qemu-devel/2015-01/msg04397.html
[2]
https://kashyapc.fedorapeople.org/virt/qemu-nbd-test/stack-traces-from-coredump.txt
> On Wed, Feb 4, 2015 at 8:48 AM, Kashyap Chamarthy <kchamart at redhat.com> wrote:
> > On Wed, Feb 04, 2015 at 10:27:34AM +0000, Daniel P. Berrange wrote:
> >> On Wed, Feb 04, 2015 at 11:23:34AM +0100, Kashyap Chamarthy wrote:
> >> > Heya,
> >> >
> >> > I noticed a ping (but couldn't respond in time) on #openstack-nova IRC
> >> > about turning on logging in libvirt to capture Nova failures.
> >> >
> >> > This was discussed on this list previously by Daniel Berrange, just
> >> > spelling it out here for reference and completness' sake.
> >> >
> >> >
> >> > (1) To see the interactions between libvirt and QEMU, in
> >> > /etc/libvirt/libvirtd.conf, have these two config attributes:
> >> >
> >> > . . .
> >> > log_filters="1:libvirt 1:qemu 1:conf 1:security 3:event 3:json 3:file 1:util"
> >>
> >> You really want "3:object" in there /before/ 1:util too otherwise you'll
> >> be spammed with object ref/unref messages
> >
> > Thanks for this detail.
> >
> >>
> >> > log_outputs="1:file:/var/tmp/libvirtd.log"
> >>
> >> Use /var/log/libvirt/libvirtd.log instead of /var/tmp
> >
> > Ah, yeah, it was an incorrect copy/paste.
> >
> > --
> > /kashyap
> >
--
/kashyap
More information about the OpenStack-dev
mailing list