mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-24 05:30:08 +01:00
infiniband: check that the connection to be created is a partition first
No functional change. It will make it a bit easier to produce a good error message in subsequent commit.
This commit is contained in:
parent
dda8e24a21
commit
7eca706751
1 changed files with 8 additions and 7 deletions
|
|
@ -239,14 +239,8 @@ create_and_realize (NMDevice *device,
|
|||
int parent_ifindex, p_key;
|
||||
NMPlatformError plerr;
|
||||
|
||||
if (!NM_IS_DEVICE_INFINIBAND (parent)) {
|
||||
g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED,
|
||||
"Parent interface %s must be an InfiniBand interface",
|
||||
nm_device_get_iface (parent));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s_infiniband = nm_connection_get_setting_infiniband (connection);
|
||||
g_assert (s_infiniband);
|
||||
|
||||
/* Can only create partitions at this time */
|
||||
p_key = nm_setting_infiniband_get_p_key (s_infiniband);
|
||||
|
|
@ -256,6 +250,13 @@ create_and_realize (NMDevice *device,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (!NM_IS_DEVICE_INFINIBAND (parent)) {
|
||||
g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED,
|
||||
"Parent interface %s must be an InfiniBand interface",
|
||||
nm_device_get_iface (parent));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
parent_ifindex = nm_device_get_ifindex (parent);
|
||||
if (parent_ifindex <= 0) {
|
||||
g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue