X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fdevice-handler.c;h=cc48747331dc6f3c6d161583499f5ca2d9ce5524;hp=43b9541aba9187c2198593f88f85cd5699763b60;hb=ed8a3ad086e56fa40c72c531b3f563e35a7c0753;hpb=27863350496534c1bdd6a2d48661f8973aed0945;ds=sidebyside diff --git a/discover/device-handler.c b/discover/device-handler.c index 43b9541..cc48747 100644 --- a/discover/device-handler.c +++ b/discover/device-handler.c @@ -1177,13 +1177,17 @@ void device_handler_process_url(struct device_handler *handler, } pb_url = pb_url_parse(event, event->params->value); - if (!pb_url || !pb_url->host) { + if (!pb_url || (pb_url->scheme != pb_url_file && !pb_url->host)) { status->message = talloc_asprintf(handler, _("Invalid config URL!")); goto msg; } - event->device = device_from_addr(event, pb_url); + if (pb_url->scheme == pb_url_file) + event->device = talloc_asprintf(event, "local"); + else + event->device = device_from_addr(event, pb_url); + if (!event->device) { status->message = talloc_asprintf(status, _("Unable to route to host %s"), @@ -1192,6 +1196,8 @@ void device_handler_process_url(struct device_handler *handler, } dev = discover_device_create(handler, event->device); + if (pb_url->scheme == pb_url_file) + dev->device->type = DEVICE_TYPE_ANY; ctx = device_handler_discover_context_create(handler, dev); ctx->event = event;