From 4fc8b8ccd0f2f0099fbb1d2ede137096938145be Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Mar 2012 12:01:49 -0600 Subject: [PATCH] cli: don't require a device for virtual connections They may not have had their devices created yet, and the activation process creates the device, so allow NULL device paths for activation. --- cli/src/connections.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cli/src/connections.c b/cli/src/connections.c index 622134ffb9..4b1fd0b541 100644 --- a/cli/src/connections.c +++ b/cli/src/connections.c @@ -1854,6 +1854,7 @@ do_connection_up (NmCli *nmc, int argc, char **argv) gboolean id_specified = FALSE; gboolean wait = TRUE; GError *error = NULL; + gboolean is_virtual = FALSE; /* Set default timeout for connection activation. It can take quite a long time. * Using 90 seconds. @@ -1957,9 +1958,13 @@ do_connection_up (NmCli *nmc, int argc, char **argv) g_assert (s_con); con_type = nm_setting_connection_get_connection_type (s_con); - device_found = find_device_for_connection (nmc, connection, iface, ap, nsp, &device, &spec_object, &error); + if ( nm_connection_is_type (connection, NM_SETTING_BOND_SETTING_NAME) + || nm_connection_is_type (connection, NM_SETTING_VLAN_SETTING_NAME)) + is_virtual = TRUE; - if (!device_found) { + device_found = find_device_for_connection (nmc, connection, iface, ap, nsp, &device, &spec_object, &error); + /* Virtual connection may not have their interfaces created yet */ + if (!device_found && !is_virtual) { if (error) g_string_printf (nmc->return_text, _("Error: No suitable device found: %s."), error->message); else