summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
44e10d8)
Currently, user_event_parse_conf_url sets dc->conf_url if it detects we
have a full URL (rather than a base URL). This is a little too subtle,
so replace it with an explicit output parameter.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
char **pxe_conf_files, **filename;
struct pb_url *conf_url, *url;
struct conf_context *conf;
char **pxe_conf_files, **filename;
struct pb_url *conf_url, *url;
struct conf_context *conf;
parser_info = talloc_zero(conf, struct pxe_parser_info);
conf->parser_info = parser_info;
parser_info = talloc_zero(conf, struct pxe_parser_info);
conf->parser_info = parser_info;
- conf_url = user_event_parse_conf_url(dc, dc->event);
+ conf_url = user_event_parse_conf_url(dc, dc->event, &complete_url);
if (!conf_url)
goto out_conf;
if (!conf_url)
goto out_conf;
+ if (complete_url) {
+ /* we have a complete URL; use this and we're done. */
+ dc->conf_url = conf_url;
rc = parser_request_url(dc, dc->conf_url, &buf, &len);
if (rc)
goto out_conf;
rc = parser_request_url(dc, dc->conf_url, &buf, &len);
if (rc)
goto out_conf;
}
struct pb_url *user_event_parse_conf_url(struct discover_context *ctx,
}
struct pb_url *user_event_parse_conf_url(struct discover_context *ctx,
+ struct event *event, bool *is_complete)
{
const char *conffile, *host, *bootfile;
char *p, *basedir, *url_str;
{
const char *conffile, *host, *bootfile;
char *p, *basedir, *url_str;
} else {
host = parse_host_addr(event);
if (!host) {
} else {
host = parse_host_addr(event);
if (!host) {
talloc_free(url_str);
talloc_free(basedir);
talloc_free(url_str);
talloc_free(basedir);
#if !defined(_PB_DISCOVER_USER_EVENT_H)
#define _PB_DISCOVER_USER_EVENT_H
#if !defined(_PB_DISCOVER_USER_EVENT_H)
#define _PB_DISCOVER_USER_EVENT_H
#include "device-handler.h"
#define PBOOT_USER_EVENT_SOCKET "/tmp/petitboot.ev"
#include "device-handler.h"
#define PBOOT_USER_EVENT_SOCKET "/tmp/petitboot.ev"
struct waitset;
struct pb_url *user_event_parse_conf_url(struct discover_context *ctx,
struct waitset;
struct pb_url *user_event_parse_conf_url(struct discover_context *ctx,
+ struct event *event, bool *complete_url);
char **user_event_parse_conf_filenames(
struct discover_context *ctx, struct event *event);
struct user_event *user_event_init(struct waitset *waitset,
char **user_event_parse_conf_filenames(
struct discover_context *ctx, struct event *event);
struct user_event *user_event_init(struct waitset *waitset,