summaryrefslogtreecommitdiffstats
path: root/discover/device-handler.c
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2016-05-16 16:06:30 +1000
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2016-06-28 16:17:21 +1000
commit2163af58b5e631a2a8d2acd79b541ed884ab7b57 (patch)
tree28d351c16e608f5a0bd072fcfe2dac5f1809ce97 /discover/device-handler.c
parent07a5f9f1c50a9185851cd486d732976573d15c4f (diff)
downloadtalos-petitboot-2163af58b5e631a2a8d2acd79b541ed884ab7b57.zip
talos-petitboot-2163af58b5e631a2a8d2acd79b541ed884ab7b57.tar.gz
discover/pxe-parser: Retrieve configs asynchronously
Depending on the configuration of the DHCP server and the network, tftp requests made by the pxe parser can timeout. The pxe parser makes these requests synchronously so several timeouts can block the server completely for several minutes, leaving the server unresponsive to UI requests. Rework the pxe parser such that it handles the result of each tftp request in a callback, which can complete after iterate_parsers() has returned. Each callback is allocated its own conf_context which takes a talloc reference on the discover_context so that each callback can commit new boot options after the initial iterate loop has completed. This also means talloc_unlink must be used instead by the original parent of the discover_context. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'discover/device-handler.c')
-rw-r--r--discover/device-handler.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/discover/device-handler.c b/discover/device-handler.c
index 9fd9fab..cd4e3ac 100644
--- a/discover/device-handler.c
+++ b/discover/device-handler.c
@@ -861,7 +861,7 @@ out:
device_handler_boot_status(handler, status);
talloc_free(status);
- talloc_free(ctx);
+ talloc_unlink(handler, ctx);
return 0;
}
@@ -900,7 +900,7 @@ int device_handler_dhcp(struct device_handler *handler,
device_handler_boot_status(handler, status);
talloc_free(status);
- talloc_free(ctx);
+ talloc_unlink(handler, ctx);
return 0;
}
@@ -930,7 +930,7 @@ int device_handler_conf(struct device_handler *handler,
device_handler_boot_status(handler, status);
talloc_free(status);
- talloc_free(ctx);
+ talloc_unlink(handler, ctx);
return 0;
}
@@ -1162,7 +1162,7 @@ void device_handler_process_url(struct device_handler *handler,
device_handler_discover_context_commit(handler, ctx);
- talloc_free(ctx);
+ talloc_unlink(handler, ctx);
status->type = BOOT_STATUS_INFO;
status->message = talloc_asprintf(status, _("Config file %s parsed"),
OpenPOWER on IntegriCloud