Using ftrace to trace function calls from qemu-guest-agent

Posted on Wed 21 August 2019 in hints-and-kinks • Tagged with libvirt, Linux, ftrace, Qemu • 4 min read

When you are using functionality that is buried deep in the Linux kernel, ftrace can be extremely useful. Here are some suggestions on how to use it, using the example of tracing function calls from qemu-guest-agent.

Continue reading

Configuring CLI output verbosity with logging and argparse

Posted on Wed 01 May 2019 in hints-and-kinks • Tagged with Python • 4 min read

Command-line interfaces frequently produce output whose verbosity your users may want to be able to tweak. Here’s a nifty way to do that.

Continue reading

Using coverage with multiple parallel GitLab CI jobs

Posted on Sun 10 March 2019 in hints-and-kinks • Tagged with Python, CI, GitLab • 2 min read

If you ever write unit tests in Python, you are probably familiar with Ned Batchelder’s coverage tool. This article explains how you can use coverage in combination with tox and a GitLab CI pipeline, for coverage reports in your Python code.

Continue reading

Building a nested CLI parser from a dictionary

Posted on Sat 09 March 2019 in hints-and-kinks • Tagged with Python • 2 min read

Here’s a nice way to initialize a CLI argument parser in Python, with arbitrary levels of subcommands.

Continue reading

1,000 routers per tenant? Think again!

Posted on Sat 08 December 2018 in hints-and-kinks • Tagged with OpenStack • 4 min read

When you allow one of your OpenStack tenants a large number of routers, they may not be getting as many as you think they will.

Continue reading