Last article got up through allocating the memory for the ACPI Tables. Now we want to populate them.
Continue readingCategory Archives: Software
Learning ACPI for ARM64 part 1: Finding the Root.
It started as a request from our tech lead: please help triage these patches. So I lookedat the set of patches and started with what looked like the simplest one:
Fix topology for Core scheduling.
It *just* reorders the code to call
store_cpu_topology(cpu);
before
notify_cpu_starting() .
Yeah…there is no such thing as a simple patch. These are my notes as I study and learn ACPI. My assumptions are here for all to see, and may well prove to be wrong.
Lets dig in.
Continue readingPassing an Object as a Parameter
Using virt-install and cloud-init
I want to call out a stellar article that told me exactly what I needed to do in order to use virt-install and cloud-init to launch a cloud-image. The only thing I have to add is the caveat that the #cloud-config comment at the top of the user-data file is required. The system will ignore the file if it does not start with that comment. This is the easiest way I know to launch a brand new VM.
XPath for libvirt external snapshop path
The following xmllint XPath query will pull out the name of the backing file for a VM named fedora-server-36 and an external snapshot named fedora-36-post-install,
virsh snapshot-dumpxml fedora-server-36 fedora-server-36-post-install | xmllint --xpath "string(//domainsnapshot/disks/disk[@snapshot='external']/source/@file)" - |
The string function extracts the attribute value.
This value can be used in the process of using or deleting the snapshot.
Copy in for-each loops in C++
I had a bug in my OpenGL program. Here was the original code:
for (Orbitor o : orbitors){ o.calculate_position(); } |
and here was the working version
for (std::vector<Orbitor>::iterator it = orbitors.begin() ; it != orbitors.end(); ++it) { it->calculate_position(); } |
Intro to libvirt based virtualization on Linux
The processes of development, installation, testing, and debugging of software all benefit from the use of a virtual machines. If you are working in a Linux based infrastructure, you have access to the virtual machine management on your system. There are a handful of related technologies that all work together to help you get your work done.
Continue readingConan-izing an OpenGL project.
Now that I can build my app with Autotools, I want to make it work with conan. In my head, I have conan mapped to projects like cargo in rust and pip in Python. However, C++ has a far less homogenized toolchain, and I expect things are going to be more “how to make it work for you.” I started with Autotools to minimize that.
Continue readingConverting an OpenGL project to use Autotools
In a science fiction game I play, we often find ourselves asking “which side of the Sun is Mars from the Earth right now?” Since this is for a game, the exact distance is not important, just “same side” or “90 degrees ahead” is a sufficient answer. But “right now” actually means a couple hundred years in the future.
Perfect problem to write a little code to solve. Here’s what it looks like.
Continue readingParsing libvirt xmldump using xpath
In a recent article, I saw yet another example of using grep to pull information out of xml, and then to manually look for a field. However, XML is structured, and with XPath, we can pull out exactly what we need.
virsh dumpxml fedora-server-36 | xmllint --xpath "//domain/devices/disk[@device='disk']" - |
That will produce output like this:
<disk type="file" device="disk"> <driver name="qemu" type="qcow2" discard="unmap"/> <source file="/var/lib/libvirt/images/fedora-server-36.qcow2"/> <target dev="vda" bus="virtio"/> <address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/> </disk> |
Note that I did more in my XPath than required by the original article. I wanted to show an example of querying based on an attribute inside the selected node.
Update: Here is an example for what is done later in the article: pull the path out of the pool xml.
virsh pool-dumpxml default | xmllint --xpath "//pool/target/path/text()" - /var/lib/libvirt/images |