def METHOD_NAME(vm):
    remove_failed = 0
    snaps = virsh.snapshot_list(vm)
    for snap in snaps:
        try:
            virsh.snapshot_delete(vm, snap)
        except process.CmdError:
            logging.debug("Can not remove snapshot %s.", snap)
            remove_failed = remove_failed + 1
    return remove_failed