NetworkManager/clients/cloud-setup
Thomas Haller 494819bbbf
cloud-setup: move common code for get_config() to base class and improve cancellation
First note that all three provider implementations are very similar.
That is why NMCSProvider's implementation does already some work that
is common to all implementations. For example, it provides the
NMCSProviderGetConfigTaskData structure to help tracking the data of
the request.

Also note that the GCP/Azure implementations didn't handle the
cancellation correctly. They always would pass

    g_task_get_cancellable(get_config_data->task)

to the asynchronous requests. That is the GCancellable provider by the
caller. That is fine when there is only one async operation ongoing. But
that is not the case, we have parallel HTTP requests.
Then, when an error happened, the overall get_config() operations fails
and the still pending requests should all be aborted. However, we must
not cancel the GCancellable of the user (because that is not owned by us).
The correct solution is to use an internal cancellable in those cases.

Anyway. Since all of this is similar, we can extend the base class
to handle things for us. This also gets the cancellation right by having
a "get_config_data->intern_cancellable".
2021-01-08 16:32:48 +01:00
..
90-nm-cloud-setup.sh cloud-setup: let dispatcher script run tool only if service is enabled 2019-12-03 16:18:33 +01:00
main.c all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
meson.build all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-cloud-setup-utils.c all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-cloud-setup-utils.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-cloud-setup.service.in cloud-setup: add tool for automatic IP configuration in cloud 2020-07-29 15:56:15 +02:00
nm-cloud-setup.timer cloud-setup: add tool for automatic IP configuration in cloud 2019-11-28 19:52:18 +01:00
nm-http-client.c all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-http-client.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nmcs-provider-azure.c cloud-setup: move common code for get_config() to base class and improve cancellation 2021-01-08 16:32:48 +01:00
nmcs-provider-azure.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nmcs-provider-ec2.c cloud-setup: move common code for get_config() to base class and improve cancellation 2021-01-08 16:32:48 +01:00
nmcs-provider-ec2.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nmcs-provider-gcp.c cloud-setup: move common code for get_config() to base class and improve cancellation 2021-01-08 16:32:48 +01:00
nmcs-provider-gcp.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nmcs-provider.c cloud-setup: move common code for get_config() to base class and improve cancellation 2021-01-08 16:32:48 +01:00
nmcs-provider.h cloud-setup: move common code for get_config() to base class and improve cancellation 2021-01-08 16:32:48 +01:00