| 1219 | // Helper for creating a disk source with type `BLOCK' |
| 1220 | template <typename TResource> |
| 1221 | inline typename TResource::DiskInfo::Source createDiskSourceBlock( |
| 1222 | const Option<std::string>& id = None(), |
| 1223 | const Option<std::string>& profile = None()) |
| 1224 | { |
| 1225 | typename TResource::DiskInfo::Source source; |
| 1226 | |
| 1227 | source.set_type(TResource::DiskInfo::Source::BLOCK); |
| 1228 | |
| 1229 | if (id.isSome()) { |
| 1230 | source.set_id(id.get()); |
| 1231 | } |
| 1232 | |
| 1233 | if (profile.isSome()) { |
| 1234 | source.set_profile(profile.get()); |
| 1235 | } |
| 1236 | |
| 1237 | return source; |
| 1238 | } |
| 1239 | |
| 1240 | |
| 1241 | // Helper for creating a disk source with type `RAW'. |