示例#1
0
/* Decommission -- Discard agent */
int ndmca_destroy(struct ndm_session* sess)
{
  if (!sess->control_acb) { return 0; }

  ndmca_destroy_media_table(&sess->control_acb->job.media_tab);
  ndmca_destroy_media_table(&sess->control_acb->job.result_media_tab);

  if (sess->control_acb->job.tape_target) {
    NDMOS_API_FREE(sess->control_acb->job.tape_target);
  }

  if (sess->control_acb->job.robot_target) {
    NDMOS_API_FREE(sess->control_acb->job.robot_target);
  }

  if (sess->control_acb->smc_cb) {
    smc_cleanup_element_status_data(sess->control_acb->smc_cb);
    NDMOS_API_FREE(sess->control_acb->smc_cb);
  }

  NDMOS_API_FREE(sess->control_acb);
  sess->control_acb = NULL;

  return 0;
}
示例#2
0
int
jndex_merge_media (void)
{
	struct ndmmedia *	me;
	struct ndmmedia *	jme;
	int			i;

	for (jme = ji_media.head; jme; jme = jme->next) {
		if (! jme->valid_label)
			continue;	/* can't match it up */

		for (me = m_media.head; me; me = me->next) {
			if (! me->valid_label)
				continue;	/* can't match it up */

			if (strcmp (jme->label, me->label) != 0)
				continue;

			if (!jme->valid_slot &&  me->valid_slot) {
				jme->slot_addr = me->slot_addr;
				jme->valid_slot = 1;
			}
		}
	}

	ndmca_destroy_media_table (&m_media);
	m_media = ji_media;

	ndmjob_log (3, "After merging input -J index with -m entries");
	i = 0;
	for (me = m_media.head; me; me = me->next) {
		char		buf[40];

		ndmmedia_to_str (me, buf);
		ndmjob_log (3, "%d: -m %s", i + 1, buf);
		i++;
	}

	return 0;
}