[libvirt] [PATCH] esx: Reduce code duplication in generator