return;
}
+ DPRINTF("Started instance %s::%s\n", in->srv->name, in->name);
in->proc.pid = pid;
uloop_process_add(&in->proc);
}
}
void
-instance_init(struct service_instance *in, struct blob_attr *config)
+instance_init(struct service_instance *in, struct service *s, struct blob_attr *config)
{
+ in->srv = s;
in->name = blobmsg_name(config);
in->config = config;
in->timeout.cb = instance_timeout;
struct service_instance {
struct vlist_node node;
+ struct service *srv;
const char *name;
bool valid;
void instance_start(struct service_instance *in);
void instance_stop(struct service_instance *in, bool restart);
bool instance_update(struct service_instance *in, struct service_instance *in_new);
-void instance_init(struct service_instance *in, struct blob_attr *config);
+void instance_init(struct service_instance *in, struct service *s, struct blob_attr *config);
void instance_free(struct service_instance *in);
void instance_dump(struct blob_buf *b, struct service_instance *in);
if (!in)
return;
- instance_init(in, attr);
+ instance_init(in, s, attr);
vlist_add(&s->instances, &in->node, (void *) name);
}