- SSH into the machine where qemu-kvm crashed
- debuginfo-install qemu-kvm => This should install a bunch of packages to get a lot of symbol info.
- gdb /usr/libexec/qemu-kvm <path to core file>
- Pass "thread apply all bt" to get the backtrace at the gdb prompt
Monday, August 3, 2015
Getting backtrace from qemu-kvm crash
When I'm running automated tests, qemu-kvm sometimes crashes and this needs to be debugged ASAP. To file a bug, I need a backtrace. As part of the test, the core which is dumped is saved.
Thursday, July 30, 2015
./configure options
When building packages, often we need to run ./configure with a bunch of options to build the package. To find out what the last options were used for configure, use this command:
How to remember ./configure script arguments a year later
./config.status --config
How to remember ./configure script arguments a year later
Monday, July 13, 2015
Execute a command, display output and get it's return code in Python
Often in my tests, I need to display the output and use the return code of the command I want to run. But I can't use check_output because my tests need to support RHEL6 and RHEL7 and RHEL6 is still on python 2.6.x and check_output is only available in Python 2.7
The following code snippet is modified from another website:
The following code snippet is modified from another website:
from subprocess import Popen, PIPEcmd = "blah blah"process = Popen(cmd.split(), stdout=PIPE)process.communicate() # execute it, the output goes to the stdoutexit_code = process.wait() # when finished, get the exit codeThursday, July 2, 2015
Access Environment Vars in Python
To access environment variables in Python, import os module and run the following command
import os
print os.environ['ENV_VAR_YOU_WANT']
Monday, June 29, 2015
Combine 2 commits into one and update pull request
Finally, I was able to combine 2 commits into 1 commit and update the pull request. This will save me lots of time instead of creating a new pull request everytime and re-do work.
First time:
First time:
git clone <my-clone-of-upstream-repo>
cd <upstream-repo>
git remote add upstream <upstream-repo>
git config --global push.default simple
When starting a new pull request:
git checkout -b <new-branch>
Make changes, commit and send pull request.
When combining n commits:
git fetch upstream
git merge-base new-branch master => This will generate a commit hash
git rebase --interactive <commit hash>
Your text editor will open with a file that lists all the commits in new-branch, and in front of each commit is the word "pick". For every line except the first, you want to replace the word "pick" with the word "squash" or "fixup". Save this file.
git rebase upstream/master
git push -f
Thursday, June 11, 2015
Start vim without .vim settings
In my .vim settings, I have audo indent and smart indent enabled. Sometimes when I'm copying code, this causes the code to completely go wonky.
So, to avoid this and just copy the code, I disable the vim settings and open the file using
So, to avoid this and just copy the code, I disable the vim settings and open the file using
vim -u NONE filename
Wednesday, May 27, 2015
Restarting gnome-shell
Often, my desktop will get stuck into a weird position - particularly when I plug in and out of my dock (multi-monitors). Restarting gnome-shell fixes the problem.
You can restart the gnome-shell by pressing Alt+F2 and then typing in either "restart" or just "r" and pressing enter
You can restart the gnome-shell by pressing Alt+F2 and then typing in either "restart" or just "r" and pressing enter
Subscribe to:
Posts (Atom)