diff mbox

opal-prd: Display messages at startup and shutdown

Message ID 1445400844-24370-1-git-send-email-joel@jms.id.au
State Accepted
Headers show

Commit Message

Joel Stanley Oct. 21, 2015, 4:14 a.m. UTC
On a system the PRD daemon was starting without a PNOR path, and it was
hard to diagnose what had happened. These messages should help in that
case.

Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 external/opal-prd/opal-prd.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Jeremy Kerr Oct. 21, 2015, 5:12 a.m. UTC | #1
Hi Joel,

> On a system the PRD daemon was starting without a PNOR path, and it was
> hard to diagnose what had happened. These messages should help in that
> case.

Acked-by: Jeremy Kerr <jk@ozlabs.org>

Bonus points: have opal-prd find the PNOR device automatically. :)

Cheers,


Jeremy
Cédric Le Goater Oct. 21, 2015, 1:36 p.m. UTC | #2
On 10/21/2015 07:12 AM, Jeremy Kerr wrote:
> Hi Joel,
> 
>> On a system the PRD daemon was starting without a PNOR path, and it was
>> hard to diagnose what had happened. These messages should help in that
>> case.
> 
> Acked-by: Jeremy Kerr <jk@ozlabs.org>
> 
> Bonus points: have opal-prd find the PNOR device automatically. :)

There should be code in gard doing it. 

Btw, couldn't we use the get_dev_mtd() routine from external/common/ in 
the opal-prd daemon and in the gard command ? This looks like common code.

C.
Joel Stanley Oct. 21, 2015, 11:58 p.m. UTC | #3
On Thu, Oct 22, 2015 at 12:06 AM, Cédric Le Goater <clg@fr.ibm.com> wrote:
>>> On a system the PRD daemon was starting without a PNOR path, and it was
>>> hard to diagnose what had happened. These messages should help in that
>>> case.
>>
>> Acked-by: Jeremy Kerr <jk@ozlabs.org>
>>
>> Bonus points: have opal-prd find the PNOR device automatically. :)
>
> There should be code in gard doing it.
>
> Btw, couldn't we use the get_dev_mtd() routine from external/common/ in
> the opal-prd daemon and in the gard command ? This looks like common code.

Good idea, thanks both of you for the suggestion. This code was
written pre-gard tool so it would be good to share some code.

Jeremy, we're happy to pull in the common code to opal-prd?

Joel
Jeremy Kerr Oct. 21, 2015, 11:59 p.m. UTC | #4
Hi Joel,

> Good idea, thanks both of you for the suggestion. This code was
> written pre-gard tool so it would be good to share some code.
> 
> Jeremy, we're happy to pull in the common code to opal-prd?

Yep, definitely. As long as it builds :D

Cheers,


Jeremy
Stewart Smith Oct. 23, 2015, 3:40 a.m. UTC | #5
Joel Stanley <joel@jms.id.au> writes:
> On a system the PRD daemon was starting without a PNOR path, and it was
> hard to diagnose what had happened. These messages should help in that
> case.
>
> Signed-off-by: Joel Stanley <joel@jms.id.au>

Thanks, applied as of 22f0fc39a7f9
diff mbox

Patch

diff --git a/external/opal-prd/opal-prd.c b/external/opal-prd/opal-prd.c
index 83c5cb5..0004b3d 100644
--- a/external/opal-prd/opal-prd.c
+++ b/external/opal-prd/opal-prd.c
@@ -1499,6 +1499,8 @@  static int run_prd_daemon(struct opal_prd_ctx *ctx)
 	/* log to syslog */
 	pr_log_daemon_init();
 
+	pr_debug("CTRL: Starting PRD daemon\n");
+
 	ctx->fd = -1;
 	ctx->socket = -1;
 
@@ -1560,6 +1562,8 @@  static int run_prd_daemon(struct opal_prd_ctx *ctx)
 			pr_log(LOG_ERR, "PNOR: Failed to open pnor: %m");
 			goto out_close;
 		}
+	} else {
+		pr_log(LOG_WARNING,"PNOR: No path provided, access will fail\n");
 	}
 
 	ipmi_init(ctx);
@@ -1585,6 +1589,7 @@  static int run_prd_daemon(struct opal_prd_ctx *ctx)
 	rc = 0;
 
 out_close:
+	pr_debug("CTRL: stopping PRD daemon\n");
 	pnor_close(&ctx->pnor);
 	if (ctx->fd != -1)
 		close(ctx->fd);