This patch series adds a check to validate the backing format before creating an image file. This ensures we provide a clear error message as early as possible when an unsupported format is used.
The first three patches clean up code on the way and the last patch makes the actual backing format validation change.