xenserver: Improve efficiency of code by using get_all_records_where()