- int level;
- long size;
-
- for(level = 0; level < DUMP_LEVELS; level++) {
- if (est->est[level].needestimate) {
- dbprintf(("%s: getting size via wrapper for %s level %d\n",
- debug_prefix_time(NULL), est->amname, level));
- size = getsize_wrapper(est->program, est->amname, est->amdevice, level, est->options,
- est->est[level].dumpsince);
+ int level;
+ int i;
+ int levels[DUMP_LEVELS];
+ int nb_level = 0;
+ backup_support_option_t *bsu;
+ GPtrArray *errarray;
+
+ bsu = backup_support_option(est->dle->program, g_options, est->dle->disk,
+ est->dle->device, &errarray);
+ if (!bsu) {
+ guint i;
+ for (i=0; i < errarray->len; i++) {
+ char *line;
+ char *errmsg;
+ char *qerrmsg;
+ line = g_ptr_array_index(errarray, i);
+ if(am_has_feature(g_options->features,
+ fe_rep_sendsize_quoted_error)) {
+ errmsg = g_strdup_printf(_("Application '%s': %s"),
+ est->dle->program, line);
+ qerrmsg = quote_string(errmsg);
+ for (level = 0; level < DUMP_LEVELS; level++) {
+ if (est->est[level].needestimate) {
+ g_printf(_("%s %d ERROR %s\n"),
+ est->dle->disk, level, qerrmsg);
+ dbprintf(_("%s %d ERROR A %s\n"),
+ est->qamname, level, qerrmsg);
+ }
+ }
+ amfree(errmsg);
+ amfree(qerrmsg);
+ }
+ }
+ if (i == 0) { /* nothing in errarray */
+ char *errmsg;
+ char *qerrmsg;
+ errmsg = g_strdup_printf(
+ _("Application '%s': cannon execute support command"),
+ est->dle->program);
+ qerrmsg = quote_string(errmsg);
+ for (level = 0; level < DUMP_LEVELS; level++) {
+ if (est->est[level].needestimate) {
+ g_printf(_("%s %d ERROR %s\n"),
+ est->dle->disk, level, qerrmsg);
+ dbprintf(_("%s %d ERROR %s\n"),
+ est->qamname, level, qerrmsg);
+ }
+ }
+ amfree(errmsg);
+ amfree(qerrmsg);
+ }
+ for (level = 0; level < DUMP_LEVELS; level++) {
+ est->est[level].needestimate = 0;
+ }
+ g_ptr_array_free(errarray, TRUE);
+ }