mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-30 23:48:05 +02:00
infiniband: consistently use the error code
Only report CREATION_FAILED when we did actually attempt creation.
(cherry picked from commit dda8e24a21)
This commit is contained in:
parent
af7321ae3f
commit
6223d32e90
1 changed files with 3 additions and 3 deletions
|
|
@ -240,7 +240,7 @@ create_and_realize (NMDevice *device,
|
|||
NMPlatformError plerr;
|
||||
|
||||
if (!NM_IS_DEVICE_INFINIBAND (parent)) {
|
||||
g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED,
|
||||
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;
|
||||
|
|
@ -251,14 +251,14 @@ create_and_realize (NMDevice *device,
|
|||
/* Can only create partitions at this time */
|
||||
p_key = nm_setting_infiniband_get_p_key (s_infiniband);
|
||||
if (p_key < 0) {
|
||||
g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED,
|
||||
g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED,
|
||||
"only InfiniBand partitions can be created");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
parent_ifindex = nm_device_get_ifindex (parent);
|
||||
if (parent_ifindex <= 0) {
|
||||
g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED,
|
||||
g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED,
|
||||
"failed to get InfiniBand parent %s ifindex",
|
||||
nm_device_get_iface (parent));
|
||||
return FALSE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue