Why would you want it in a function?  We can always add the delete-chroot then.