+static char *
+taper_splitting_args(
+ disk_t *dp)
+{
+ GString *args = NULL;
+ char *q = NULL;
+ dumptype_t *dt = dp->config;
+ tapetype_t *tt;
+
+ tt = lookup_tapetype(getconf_str(CNF_TAPETYPE));
+ g_assert(tt != NULL);
+
+ args = g_string_new("");
+
+ /* old dumptype-based parameters, using empty strings when not seen */
+ if (dt) { /* 'dt' may be NULL for flushes */
+ if (dumptype_seen(dt, DUMPTYPE_TAPE_SPLITSIZE)) {
+ g_string_append_printf(args, "%ju ",
+ (uintmax_t)dumptype_get_tape_splitsize(dt)*1024);
+ } else {
+ g_string_append(args, "\"\" ");
+ }
+
+ q = quote_string(dumptype_seen(dt, DUMPTYPE_SPLIT_DISKBUFFER)?
+ dumptype_get_split_diskbuffer(dt) : "");
+ g_string_append_printf(args, "%s ", q);
+ g_free(q);
+
+ if (dumptype_seen(dt, DUMPTYPE_FALLBACK_SPLITSIZE)) {
+ g_string_append_printf(args, "%ju ",
+ (uintmax_t)dumptype_get_fallback_splitsize(dt)*1024);
+ } else {
+ g_string_append(args, "\"\" ");
+ }
+
+ if (dumptype_seen(dt, DUMPTYPE_ALLOW_SPLIT)) {
+ g_string_append_printf(args, "%d ",
+ (int)dumptype_get_allow_split(dt));
+ } else {
+ g_string_append(args, "\"\" ");
+ }
+ } else {
+ g_string_append(args, "\"\" \"\" \"\" \"\" ");
+ }
+
+ /* new tapetype-based parameters */
+ if (tapetype_seen(tt, TAPETYPE_PART_SIZE)) {
+ g_string_append_printf(args, "%ju ",
+ (uintmax_t)tapetype_get_part_size(tt)*1024);
+ } else {
+ g_string_append(args, "\"\" ");
+ }
+
+ q = "";
+ if (tapetype_seen(tt, TAPETYPE_PART_CACHE_TYPE)) {
+ switch (tapetype_get_part_cache_type(tt)) {
+ default:
+ case PART_CACHE_TYPE_NONE:
+ q = "none";
+ break;
+
+ case PART_CACHE_TYPE_MEMORY:
+ q = "memory";
+ break;
+
+ case PART_CACHE_TYPE_DISK:
+ q = "disk";
+ break;
+ }
+ }
+ q = quote_string(q);
+ g_string_append_printf(args, "%s ", q);
+ g_free(q);
+
+ q = quote_string(tapetype_seen(tt, TAPETYPE_PART_CACHE_DIR)?
+ tapetype_get_part_cache_dir(tt) : "");
+ g_string_append_printf(args, "%s ", q);
+ g_free(q);
+
+ if (tapetype_seen(tt, TAPETYPE_PART_CACHE_MAX_SIZE)) {
+ g_string_append_printf(args, "%ju ",
+ (uintmax_t)tapetype_get_part_cache_max_size(tt)*1024);
+ } else {
+ g_string_append(args, "\"\" ");
+ }
+
+
+ return g_string_free(args, FALSE);
+}
+