*****************************************************************************
* rrd_restore.c creates new rrd from data dumped by rrd_dump.c
*****************************************************************************/
*****************************************************************************
* rrd_restore.c creates new rrd from data dumped by rrd_dump.c
*****************************************************************************/
{
rrd_set_error("Incompatible file version, detected version %s is bigger than supported version %s\n",
rrd -> stat_head -> version, RRD_VERSION );
{
rrd_set_error("Incompatible file version, detected version %s is bigger than supported version %s\n",
rrd -> stat_head -> version, RRD_VERSION );
- rrd_set_error("Can only restore version >= 2 (Not %s). Dump your rrd using a current rrdtool dump.", rrd -> stat_head -> version );
- free(rrd -> stat_head);
+ rrd_set_error("Can only restore version >= 2 (Not %s). Dump your old rrd using a current rrdtool dump.", rrd -> stat_head -> version );
read_tag(&ptr2,"type",DST_FMT,rrd->ds_def[rrd->stat_head->ds_cnt-1].dst);
/* test for valid type */
read_tag(&ptr2,"type",DST_FMT,rrd->ds_def[rrd->stat_head->ds_cnt-1].dst);
/* test for valid type */
read_tag(&ptr2,"cf",CF_NAM_FMT,rrd->rra_def[rrd->stat_head->rra_cnt-1].cf_nam);
/* test for valid type */
read_tag(&ptr2,"cf",CF_NAM_FMT,rrd->rra_def[rrd->stat_head->rra_cnt-1].cf_nam);
/* test for valid type */
read_tag(&ptr2,"pdp_per_row","%lu",&(rrd->rra_def[rrd->stat_head->rra_cnt-1].pdp_cnt));
/* support to read RRA parameters */
read_tag(&ptr2,"pdp_per_row","%lu",&(rrd->rra_def[rrd->stat_head->rra_cnt-1].pdp_cnt));
/* support to read RRA parameters */
}
eat_tag(&ptr2, "/params");
eat_tag(&ptr2,"cdp_prep");
}
eat_tag(&ptr2, "/params");
eat_tag(&ptr2,"cdp_prep");
/* last row in the xml file is the most recent; as
* rrd_update increments the current row pointer, set cur_row
* here to the last row. */
/* last row in the xml file is the most recent; as
* rrd_update increments the current row pointer, set cur_row
* here to the last row. */
- opt = getopt_long(argc, argv, "r:f", long_options, &option_index);
+ opt = getopt_long(argc, argv, "rf", long_options, &option_index);