From 31353099a886fc4fac4293989330847ea51e44d0 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 24 Jun 2012 23:41:32 +0200 Subject: [PATCH] add a debug message for showing starting of instances --- instance.c | 4 +++- instance.h | 3 ++- service.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/instance.c b/instance.c index 41b9419..f530ba5 100644 --- a/instance.c +++ b/instance.c @@ -64,6 +64,7 @@ instance_start(struct service_instance *in) return; } + DPRINTF("Started instance %s::%s\n", in->srv->name, in->name); in->proc.pid = pid; uloop_process_add(&in->proc); } @@ -201,8 +202,9 @@ instance_free(struct service_instance *in) } 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; diff --git a/instance.h b/instance.h index 7adaca6..011cd9c 100644 --- a/instance.h +++ b/instance.h @@ -7,6 +7,7 @@ struct service_instance { struct vlist_node node; + struct service *srv; const char *name; bool valid; @@ -23,7 +24,7 @@ struct service_instance { 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); diff --git a/service.c b/service.c index 1f1b1a8..aeef7a7 100644 --- a/service.c +++ b/service.c @@ -19,7 +19,7 @@ service_instance_add(struct service *s, struct blob_attr *attr) if (!in) return; - instance_init(in, attr); + instance_init(in, s, attr); vlist_add(&s->instances, &in->node, (void *) name); } -- 2.25.1