I tried several approaches for this PR, and in one iteration I was giving a new-ed string to libvirt, which resulted in a crash due to free-ing non-malloced memory.
At least that's how I remember it, and since I couldn't find anything in the libvirt docs I assumed that one should malloc() strings for libvirt to free().