clean up xenserver resource code