Revision 63f4bce5

b/src/Ganeti/Query/Instance.hs
284 284
  , (fieldDefinitionCompleter "nic.link/%d" "NicLink/%d" QFTText
285 285
     ("Link" ++ nicDescSuffix),
286 286
     getIndexedNicField nicpLink, QffNormal)
287
  , (fieldDefinitionCompleter "nic.vlan/%d" "NicVLAN/%d" QFTText
288
     ("VLAN" ++ nicDescSuffix),
289
     getOptionalIndexedNicField getNicVlan, QffNormal)
287 290
  , (fieldDefinitionCompleter "nic.network.name/%d" "NicNetworkName/%d" QFTText
288 291
     ("Network name" ++ nicDescSuffix),
289 292
     getIndexedNicNetworkNameField, QffNormal)
......
334 337
  | nicpMode nicParams == NMBridged = Just $ nicpLink nicParams
335 338
  | otherwise                       = Nothing
336 339

  
340
-- | Gets the VLAN of a NIC.
341
getNicVlan :: FilledNicParams -> Maybe String
342
getNicVlan params
343
  | nicpMode params == NMOvs = Just $ nicpVlan params
344
  | otherwise                = Nothing
345

  
337 346
-- | Fill partial NIC params by using the defaults from the configuration.
338 347
fillNicParamsFromConfig :: ConfigData -> PartialNicParams -> FilledNicParams
339 348
fillNicParamsFromConfig cfg = fillNicParams (getDefaultNicParams cfg)

Also available in: Unified diff