In using KVM (libvirtd) as part of my virtual "lab" environment at home, I often have at least a few guests using DHCP whose addresses have been reserved. Setting this up is simple, once you've read the documentation.
This configuation is done at the network level and found in the /etc/libvirt/qemu/networks/[networkname].xml file.
Here's a sample (from the doc) from the <ip>
section for the configuration:
<ip address="192.168.122.1" netmask="255.255.255.0" localPtr="yes">
<dhcp>
<range start="192.168.122.100" end="192.168.122.254"/>
<host mac="00:16:3e:77:e2:ed" name="foo.example.com" ip="192.168.122.10"/>
<host mac="00:16:3e:3e:a9:1a" name="bar.example.com" ip="192.168.122.11"/>
</dhcp>
</ip>
As you can see, all that needs to be done is to nest a <host>
tag in the <dhcp>
section with the mac,
name and ip address to be leased.