I am booting VMs via qemu (no libvirt) and sometimes they don't tell me what IP address they got when booted. To figure it out, considering I know the IP address, I can query the network via the Address Resolution Protocol (ARP)
I know they get address in sequence, so:
ayoung@sut11sys-r112:~/devel/ampvirt$ arp -n | grep -i "52:54:00:70:0c:"
10.76.112.154 ether 52:54:00:70:0c:02 C virbr0
10.76.112.153 ether 52:54:00:70:0c:04 C virbr0
10.76.112.155 ether 52:54:00:70:0c:03 C virbr0
Teaching Python using a Caesar Cipher
A Caesar cipher is a letter for letter exchange from a clear text to a encrypted text by shifting a set distance in the alphabet. Thus, if your set distance is 2, the letter A becomes C, the letter X becomes Z. To encrypt the last letters of the alphabet, you wrap around to the beginning, so Y becomes A and Z becomes B.
Caesar is commonly respelled to Ceasar, which I have done for this article. Use the spelling of your choice.
This is a fairly easy algorithm to code, and makes for a decent early class in python. Here are the steps I would go through to teach someone:
Father’s day project
Getting a little more organized in my workshop. My pain point was boxes of nails or screws falling off shelves.
And, of course, I wanted an excuse to use the laser cutter.


I took a lesson from Minecrafters and put an instance of what was inside the box on the front id the box.
Downloading from gitlab
We use gitlab to post internal releases of archives. I want to be able to automate the process of downloading these artifacts. Here it is using the glab CLI.
Continue readingDebugging Rust in Vim
On Fedora:
yum install termdebug
in ~/.vimrc
let g:termdebug_config = {}
let g:termdebug_config['command'] = 'rust-gdb'
packadd! termdebug
Inside vim:
Termdebug target/debug<executable>
Use Ctrl-W DownArrow to switch between windows
Use :Break to set a breakpoint in the code window
Use Ctrl-W UpArrow to go to the gdb window
use run to run the program and cont to continue after hitting a break point.
Selecting a subset of files for ctags
I usually don’t want all of the files in the linux Kernel for my ctags. Sometimes I want a cvery small subset: a set of C files and the included header files.
Continue readingFixing my virt Network
I got my network working again, and this time I am running the VM as non-root user.
Continue readingResizing filesystem on A Fedora 43 Cloud image
THe cloud image is shipped as a qcow2 file. It has about 3 GB of usable space. I need more.
Continue readingNetwork setup for a custom Qemu Virtual Machine
After building a custom Qemu, there are a couple ways to run a VM to get to it. The older approach to VM management is to create a block device, run the VM with a boot device, do a full install and log in to the serial console. However, if you run the Qemu/KVM machine from the command lilne, hitting control C will stop your VM, and this is annoying. I have found it worth while to set up networking and then to SSH in to the machine.
My notes here suck. I am going to try and document what I have here working, and, over time, reverse engineer how I got here.
Edit: here are the steps
A PCC driver in Qemu
In order to perform test driven development, you need a way to drive your code that can isolate behavior. Linux Kernel drivers that communicate with hardware devices can be hard to test: you might not have access to the hardware from your test systems, or the hardware may be flakey. I have such a set of issues with the Platform Communication Channel (PCC) drivers I am working with.
My primary work has been with a network driver that only exists on the newest hardware. However, I also need to be able to handle some drivers that would only work against old hardware. There are also PCC based drivers for hardware that my company does not support or have access to. I might want to make a test to ensure that changes to the Linux Kernel PCC driver does not change its behavior against these drivers. There exists no system where all of these drivers would be supported. But I can build one with Qemu.
The Qemu based driver might not completely simulate the hardware exactly as implemented, and that is OK: I want to be able to do things with Qemu I cannot do with current hardware. For example, the MCTP-over-PCC driver should be able to handle a wide array of messages, but the hardware I have access to only supports a very limited subset of message types.
The full code for the device is here.
Here is how I went about building a Qemu based PCC driver.
Continue reading