Exemple #1
0
/*
 *	EXTERNAL Stonith destructor...
 */
static void
external_destroy(StonithPlugin *s)
{
	struct pluginDevice *	sd;
	char **			p;

	if (Debug) {
		LOG(PIL_DEBUG, "%s: called.", __FUNCTION__);
	}

	VOIDERRIFWRONGDEV(s);

	sd = (struct pluginDevice *)s;

	sd->pluginid = NOTpluginID;
	external_unconfig(sd);
	if (sd->confignames != NULL) {
		for (p = sd->confignames; *p; p++) {
			FREE(*p);
		}
		FREE(sd->confignames);
		sd->confignames = NULL;
	}
	if (sd->subplugin != NULL) {
		FREE(sd->subplugin);
		sd->subplugin = NULL;
	}
	if (sd->outputbuf != NULL) {
		FREE(sd->outputbuf);
		sd->outputbuf = NULL;
	}
	FREE(sd);
}
Exemple #2
0
static void
wti_mpc_destroy(StonithPlugin * s)
{
    struct pluginDevice *ad;

    DEBUGCALL;

    VOIDERRIFWRONGDEV(s);

    ad = (struct pluginDevice *) s;

    ad->pluginid = NOTpluginID;

    /* release snmp session */
    if (ad->sptr != NULL) {
        snmp_close(ad->sptr);
        ad->sptr = NULL;
    }

    /* reset defaults */
    if (ad->hostname != NULL) {
        PluginImports->mfree(ad->hostname);
        ad->hostname = NULL;
    }
    if (ad->community != NULL) {
        PluginImports->mfree(ad->community);
        ad->community = NULL;
    }
    ad->num_outlets = 0;

    PluginImports->mfree(ad);
}
Exemple #3
0
static void
ibmhmc_destroy(StonithPlugin *s)
{
	struct pluginDevice* dev;

	if(Debug){
		LOG(PIL_DEBUG, "%s : called\n", __FUNCTION__);
	}

	VOIDERRIFWRONGDEV(s);

	dev = (struct pluginDevice *)s;

	dev->pluginid = NOTpluginID;
	if (dev->hmc) {
		FREE(dev->hmc);
		dev->hmc = NULL;
	}
	if (dev->password) {
		FREE(dev->password);
		dev->password = NULL;
	}
	if (dev->idinfo) {
		FREE(dev->idinfo);
		dev->idinfo = NULL;
	}
	free_hmc_hostlist(dev);
	free_hmc_mansyspats(dev);
	
	FREE(dev);
}
Exemple #4
0
/*
 *	APC MasterSwitch StonithPlugin destructor...
 */
static void
apcmaster_destroy(StonithPlugin *s)
{
	struct pluginDevice* ms;

	VOIDERRIFWRONGDEV(s);

	ms = (struct pluginDevice *)s;

	ms->pluginid = NOTpluginID;
	if (ms->rdfd >= 0) {
		close(ms->rdfd);
		ms->rdfd = -1;
	}
	if (ms->wrfd >= 0) {
		close(ms->wrfd);
		ms->wrfd = -1;
	}
	if (ms->device != NULL) {
		FREE(ms->device);
		ms->device = NULL;
	}
	if (ms->user != NULL) {
		FREE(ms->user);
		ms->user = NULL;
	}
	if (ms->passwd != NULL) {
		FREE(ms->passwd);
		ms->passwd = NULL;
	}
	FREE(ms);
}
Exemple #5
0
static void
bladehpi_destroy(StonithPlugin *s)
{
	struct pluginDevice *	dev;

	if (Debug) {
		LOG(PIL_DEBUG, "%s: called", __FUNCTION__);
	}

	VOIDERRIFWRONGDEV(s);

	dev = (struct pluginDevice *)s;

	dev->pluginid = NOTpluginID;
	if (dev->device) {
		FREE(dev->device);
		dev->device = NULL;
	}
	if (dev->idinfo) {
		FREE(dev->idinfo);
		dev->idinfo = NULL;
	}
	free_bladehpi_hostlist(dev);

	if (dev->ohsession) {
		saHpiSessionClose(dev->ohsession);
		dev->ohsession = 0;
	}
	
	FREE(dev);
}
Exemple #6
0
/*
 *	SSH Stonith destructor...
 */
static void
ssh_destroy(StonithPlugin *s)
{
	struct pluginDevice* sd = (struct pluginDevice *)s;

	VOIDERRIFWRONGDEV(s);

	sd->pluginid = NOTpluginid;
	if (sd->hostlist) {
		stonith_free_hostlist(sd->hostlist);
		sd->hostlist = NULL;
	}
	sd->hostcount = -1;
	FREE(sd);
}
Exemple #7
0
/*
 *	Meat Stonith destructor...
 */
static void
meatware_destroy(StonithPlugin *s)
{
	struct pluginDevice* nd;

	VOIDERRIFWRONGDEV(s);
	nd = (struct pluginDevice *)s;

	nd->pluginid = NOTpluginID;
	if (nd->hostlist) {
		stonith_free_hostlist(nd->hostlist);
		nd->hostlist = NULL;
	}
	nd->hostcount = -1;
	FREE(nd);
}
Exemple #8
0
/*
 *	RILOE Stonith destructor...
 */
static void
riloe_destroy(StonithPlugin *s)
{
	struct pluginDevice* nd;

	if (Debug) {
		LOG(PIL_DEBUG, "%s:called.", __FUNCTION__);
	}

	VOIDERRIFWRONGDEV(s);
	nd = (struct pluginDevice *)s;

	nd->pluginid = NOTriloeID;
	if (nd->hostlist) {
		stonith_free_hostlist(nd->hostlist);
		nd->hostlist = NULL;
	}
	nd->hostcount = -1;
	FREE(nd);
}
Exemple #9
0
/*
 *	Baytech Stonith destructor...
 */
static void
baytech_destroy(StonithPlugin *s)
{
	struct pluginDevice* bt;

	VOIDERRIFWRONGDEV(s);

	bt = (struct pluginDevice *)s;

	bt->pluginid = NOTpluginID;
	if (bt->rdfd >= 0) {
		close(bt->rdfd);
		bt->rdfd = -1;
	}
	if (bt->wrfd >= 0) {
		close(bt->wrfd);
		bt->wrfd = -1;
	}
	if (bt->device != NULL) {
		FREE(bt->device);
		bt->device = NULL;
	}
	if (bt->user != NULL) {
		FREE(bt->user);
		bt->user = NULL;
	}
	if (bt->passwd != NULL) {
		FREE(bt->passwd);
		bt->passwd = NULL;
	}
	if (bt->idinfo != NULL) {
		FREE(bt->idinfo);
		bt->idinfo = NULL;
	}
	if (bt->unitid != NULL) {
		FREE(bt->unitid);
		bt->unitid = NULL;
	}
	FREE(bt);
}