Re: [PATCH rhel6-branch 10/11] Make kickstart network command reconfigure device in installer (#668395)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> @@ -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


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux