MCPcopy
hub / github.com/lxc/incus / VolumeDBContentTypeToContentType

Function VolumeDBContentTypeToContentType

internal/server/storage/utils.go:169–180  ·  view source on GitHub ↗

VolumeDBContentTypeToContentType converts internal content type DB code to driver representation.

(volDBType int)

Source from the content-addressed store, hash-verified

167
168// VolumeDBContentTypeToContentType converts internal content type DB code to driver representation.
169func VolumeDBContentTypeToContentType(volDBType int) (drivers.ContentType, error) {
170 switch volDBType {
171 case db.StoragePoolVolumeContentTypeBlock:
172 return drivers.ContentTypeBlock, nil
173 case db.StoragePoolVolumeContentTypeFS:
174 return drivers.ContentTypeFS, nil
175 case db.StoragePoolVolumeContentTypeISO:
176 return drivers.ContentTypeISO, nil
177 }
178
179 return "", errors.New("Invalid volume content type")
180}
181
182// VolumeContentTypeNameToContentType converts volume content type string internal code.
183func VolumeContentTypeNameToContentType(contentTypeName string) (int, error) {

Callers 12

RefreshCustomVolumeMethod · 0.85
DeleteImageMethod · 0.85
MigrateCustomVolumeMethod · 0.85
UpdateCustomVolumeMethod · 0.85
DeleteCustomVolumeMethod · 0.85
RebuildCustomVolumeMethod · 0.85
RestoreCustomVolumeMethod · 0.85
BackupCustomVolumeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…