Debugging with Qemu: Difference between revisions

Adds 'correct' start command
m Text replacement - "<(\/?)source" to "<$1syntaxhighlight"
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
== Analyze Failures ==
=== Background ===
This question was a challenge because I have never done kernel debugging, or used QEMU before.  But a few doses of Google later, and using simple deduction based on other experiences, I'm getting through.
This question was a challenge because I have never done kernel debugging, or used QEMU before.  But a few doses of Google later, and using simple deduction based on other experiences, I'm getting through.


Line 7: Line 11:
So, I installed QEMU + dependencies on my Bionic workstation.
So, I installed QEMU + dependencies on my Bionic workstation.


=== Command to Start ===
> Please show the commands you use to start via libvirt with this XML.
> Please show the commands you use to start via libvirt with this XML.


The xml had <code>/usr/bin/kvm-spice</code> in it as the emulator; so I searched <code>dpkg -S  /usr/bin/kvm-spice</code> which turns out to be '''qemu-kvm''' (that I already have installed).  So I assume that I'll need to run qemu-kvm. So then I researched how to start a qemu-kvm session/machine, using libvirt, and given an XML manifest / configuration file.  I didn't find anything like that, so I went with basic commands for starting QEMU. (Failing fast and early reveals the path to perfection.) Listing the user and system emulators in <code>/usr/bin/qemu-*</code>, there is <code>qemu-system-x86_64-spice</code>. I started the system with:  
The xml had <code>/usr/bin/kvm-spice</code> in it as the emulator; so I searched <code>dpkg -S  /usr/bin/kvm-spice</code> which turns out to be '''qemu-kvm''' (that I already have installed).  So I assume that I'll need to run qemu-kvm. So then I researched how to start a qemu-kvm session/machine, using libvirt, and given an XML manifest / configuration file.  I didn't find anything like that, so I went with basic commands for starting QEMU. (Failing fast and early reveals the path to perfection.) Listing the user and system emulators in <code>/usr/bin/qemu-*</code>, there is <code>qemu-system-x86_64-spice</code>. I started the system with:  


<source lang="bash">/usr/bin/qemu-system-x86_64-spice -hda /home/greg/Downloads/debug-crash.qcow
<syntaxhighlight lang="bash">/usr/bin/qemu-system-x86_64-spice -hda /home/greg/Downloads/debug-crash.qcow
</source>
</syntaxhighlight>


But, from the Arch wiki<ref>https://wiki.archlinux.org/index.php/QEMU</ref> I found that  
But, from the Arch wiki<ref>https://wiki.archlinux.org/index.php/QEMU</ref> I found that  
Line 49: Line 55:




== Apache ==
=== Apache ===
> Apache is not starting, why?
> Apache is not starting, why?
There's a syntax error on line 153 of /etc/apache2/apache2.conf. More accurately, it can not open the file that it's trying to open at /etc/apache2/extra.conf.  And actually, looking at that file, someone with a sense of humor symlinked it to <code>/dev/urandom</code> -- which is why Apache has a problem with the syntax :-D
There's a syntax error on line 153 of /etc/apache2/apache2.conf. More accurately, it can not open the file that it's trying to open at /etc/apache2/extra.conf.  And actually, looking at that file, someone with a sense of humor symlinked it to <code>/dev/urandom</code> -- which is why Apache has a problem with the syntax :-D




=== Crash File ===
> What is going on with /var/crash/_usr_sbin_postconf.1000.crash?


== LDFLAGS ==
TBD
 
== Makefile Weirdness (LDFLAGS) ==
> It turns out this change actually made LDFLAGS empty. Why?
> It turns out this change actually made LDFLAGS empty. Why?
I thought this was a trick question, because it looked like the syntax for $CFLAGS and $CPPFLAGS are incorrect. But, that syntax actually does look correct. Since the sed expression also looks correct, I have to surmise that somehow CFLAGS and/or LDFLAGS weren't configured correctly. But that's only a guess.  '''R'''eading '''T'''he '''F'''ine '''M'''anual on <code>dpkg-buildflags</code>, it tells me that <code>LDFLAGS</code> defaults to empty. So sed is a no-op, and LDFLAGS would still be empty.
 
I thought this was a trick question, because it looked like the syntax for $CFLAGS and $CPPFLAGS are incorrect. But, that syntax actually does look correct. Since the sed expression also looks correct, I thought that somehow CFLAGS and/or LDFLAGS weren't configured correctly. But that was only a guess.  '''R'''eading '''T'''he '''F'''ine '''M'''anual on <code>dpkg-buildflags</code>, it tells me that <span style="background-color:#a8e2a8;"> <code>LDFLAGS</code> defaults to empty. So sed is a no-op, and LDFLAGS would still be empty.</span>