Skip to content
  • Pavel Šimerda's avatar
    core: match connections to connections instead of devices · c1f45eb2
    Pavel Šimerda authored
    
    
    This backwards compatible patch adds the possibility to use new
    nm_device_generate_connection() API via update_connection() virtual
    method implementations in NMDevice subclasses.
    
    Compatibility is achieved by first trying to use the older API and
    match_l2_config() virtual method and only then moving on to
    update_connection().
    
    The nm_device_generate_connection() calls update_connection() to create
    type-specific NMSetting instances and verifies the connection before
    returning it. To avoid tinkering with NMSettingConnection in
    update_connection() we use a class attribute called connection_type
    which is used by nm_device_generate_connection() itself.
    
    Known issues:
    
    * nm_device_generate_connection() method doesn't implement DHCP lease
    configuration matching. We shouldn't actually need it but if a use case
    for that will come out, we can fix it later.
    
    * nm_device_generate_connection() doesn't fill in the slave-specific
    options.
    
    * update_connection() is not implemented and connection_type is not set
    in the subclasses. This will be fixed in individual patches.
    
    * NMSetting's compare_property() implementations in combination with
    NM_SETTING_COMPARE_FLAG_CANDIDATE are not yet fully ready thus rendering
    false negatives in some cases. Same as above.
    
    Acked-by: default avatarDan Winship <danw@gnome.org>
    Acked-by: default avatarThomas Haller <thaller@redhat.com>
    c1f45eb2