The current approach in set_id_and_name is @ https://github.com/bdpayne/libvmi/blob/master/libvmi/core.c#L574

This will fail if the domain name was not found, even if the domain ID itself is valid. This should be allowed for (at least) xen. This requires a separate functions to validate the ID (which seems to be what was the intention of the original approach) and a function to get the name.