> @@ -2181,4 +2229,80 @@ int wait_for_iface_activation(char *ifname) { > return 3; > } > > +/* > + * Wait for disconnection of iface by NetworkManager, return non-zero on error. > + */ > +int wait_for_iface_disconnection(char *ifname) { ... > + devices = nm_client_get_devices(client); > + for (i = 0; i < devices->len; i++) { > + NMDevice *candidate = g_ptr_array_index(devices, i); > + const char *name = nm_device_get_iface(candidate); > + if (!strcmp(name, ifname)) { > + device = candidate; > + break; > + } > + } > + if (device == NULL) { > + logMessage(ERROR, "%s (%d): network device %s not found", > + __func__, __LINE__, ifname); > + g_object_unref(client); > + return 3; > + } I've seen this same idiom in a couple places now, so it really seems like the sort of thing that could get turned into a function. Also, don't you need to free devices somewhere? It doesn't appear we do anywhere else in anaconda, though, so maybe not. I'm not sure how nm_client_get_devices behaves. - Chris _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list