Use more flexible method to check added partitions

Modify check_in_vm function.