Validates the ReservationInfos specified in the given resources (if exist). Returns error if any ReservationInfo is found invalid or unsupported.
| 847 | // exist). Returns error if any ReservationInfo is found invalid or |
| 848 | // unsupported. |
| 849 | Option<Error> validateDynamicReservationInfo( |
| 850 | const RepeatedPtrField<Resource>& resources) |
| 851 | { |
| 852 | foreach (const Resource& resource, resources) { |
| 853 | if (!Resources::isDynamicallyReserved(resource)) { |
| 854 | continue; |
| 855 | } |
| 856 | |
| 857 | if (Resources::isRevocable(resource)) { |
| 858 | return Error( |
| 859 | "Dynamically reserved resource " + stringify(resource) + |
| 860 | " cannot be created from revocable resources"); |
| 861 | } |
| 862 | } |
| 863 | |
| 864 | return None(); |
| 865 | } |
| 866 | |
| 867 | |
| 868 | // Validates the DiskInfos specified in the given resources (if |