Modify some functions according to virttest implementation.