This is a multi-part message in MIME format.
--------------F408C55ECE3C7DF0977EF860
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
I've been thinking about STONITH things for a while, and have come up
with an API which seems reasonable to me. I've attached it for your
reading pleasure.
I have implemented it for one particular type of STONITH device, and it
seems to work pretty well.
As always, I look forward to your comments.
Thanks!
-- Alan Robertson
alanr@suse.com
--------------F408C55ECE3C7DF0977EF860
Content-Type: text/plain; charset=us-ascii;
name="stonith.h"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="stonith.h"
/*
* S hoot
* T he
* O ther
* N ode
* I n
* T he
* H ead
*
* Cause the other machine to reboot or die - now.
*
* We guarantee that when we report that the machine has been
* rebooted, then it has been (barring misconfiguration or hardware errors)
*
* A machine which we have STONITHed won't do anything more to its peripherials
* etc. until it goes through the reboot cycle.
*/
/*
* Return codes from "Stonith" member functions.
*/
#define S_OK 0 /* Machine correctly reset */
#define S_BADCONFIG 1 /* Bad config info given */
#define S_NOACCESS 2 /* Can't access STONITH device */
/* (login/passwd problem?) */
#define S_BADHOST 3 /* Bad/illegal host/node name */
#define S_RESETFAIL 4 /* Reset failed */
#define S_OOPS 5 /* Something strange happened */
typedef struct stonith {
struct stonith_ops * s_ops;
void * pinfo;
}Stonith;
/*
* These functions all use syslog(3) for error messages.
* Consequently they assume you've done an openlog() to initialize it for them.
*/
struct stonith_ops {
void (*delete) (Stonith* s); /* Stonith Destructor */
int (*set_config_file) (Stonith * s, const char * filename);
int (*set_config_info) (Stonith * s, const char * configstring);
/*
* Must call set_config_info or set_config_file before calling any of
* these.
*/
int (*reset_host) (Stonith * s, const char * hostname);
char**(*hostlist) (Stonith* s);
/* Returns list of hosts it supports */
};
extern Stonith * stonith_new(const char * type);
--------------F408C55ECE3C7DF0977EF860--
--------------F408C55ECE3C7DF0977EF860
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
I've been thinking about STONITH things for a while, and have come up
with an API which seems reasonable to me. I've attached it for your
reading pleasure.
I have implemented it for one particular type of STONITH device, and it
seems to work pretty well.
As always, I look forward to your comments.
Thanks!
-- Alan Robertson
alanr@suse.com
--------------F408C55ECE3C7DF0977EF860
Content-Type: text/plain; charset=us-ascii;
name="stonith.h"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="stonith.h"
/*
* S hoot
* T he
* O ther
* N ode
* I n
* T he
* H ead
*
* Cause the other machine to reboot or die - now.
*
* We guarantee that when we report that the machine has been
* rebooted, then it has been (barring misconfiguration or hardware errors)
*
* A machine which we have STONITHed won't do anything more to its peripherials
* etc. until it goes through the reboot cycle.
*/
/*
* Return codes from "Stonith" member functions.
*/
#define S_OK 0 /* Machine correctly reset */
#define S_BADCONFIG 1 /* Bad config info given */
#define S_NOACCESS 2 /* Can't access STONITH device */
/* (login/passwd problem?) */
#define S_BADHOST 3 /* Bad/illegal host/node name */
#define S_RESETFAIL 4 /* Reset failed */
#define S_OOPS 5 /* Something strange happened */
typedef struct stonith {
struct stonith_ops * s_ops;
void * pinfo;
}Stonith;
/*
* These functions all use syslog(3) for error messages.
* Consequently they assume you've done an openlog() to initialize it for them.
*/
struct stonith_ops {
void (*delete) (Stonith* s); /* Stonith Destructor */
int (*set_config_file) (Stonith * s, const char * filename);
int (*set_config_info) (Stonith * s, const char * configstring);
/*
* Must call set_config_info or set_config_file before calling any of
* these.
*/
int (*reset_host) (Stonith * s, const char * hostname);
char**(*hostlist) (Stonith* s);
/* Returns list of hosts it supports */
};
extern Stonith * stonith_new(const char * type);
--------------F408C55ECE3C7DF0977EF860--