Exemple #1
0
char *
do_ldmtool_diskgroup_name (const char *diskgroup)
{
  int r;
  CLEANUP_FREE char *out = NULL, *err = NULL;

  r = command (&out, &err, "ldmtool", "show", "diskgroup", diskgroup, NULL);
  if (r == -1) {
    reply_with_error ("%s", err);
    return NULL;
  }

  return parse_json_get_object_string (out, "name", 0,
                                       __func__, "ldmtool show diskgroup");
}
Exemple #2
0
char *
do_ldmtool_volume_hint (const char *diskgroup, const char *volume)
{
  int r;
  CLEANUP_FREE char *out = NULL, *err = NULL;

  r = command (&out, &err,
               "ldmtool", "show", "volume", diskgroup, volume, NULL);
  if (r == -1) {
    reply_with_error ("%s", err);
    return NULL;
  }

  return parse_json_get_object_string (out, "hint", GET_STRING_NULL_TO_EMPTY,
                                       __func__, "ldmtool show volume");
}
Exemple #3
0
char *
do_ldmtool_volume_type (const char *diskgroup, const char *volume)
{
  int r;
  CLEANUP_FREE char *out = NULL, *err = NULL;

  r = command (&out, &err,
               str_ldmtool, "show", "volume", diskgroup, volume, NULL);
  if (r == -1) {
    reply_with_error ("%s", err);
    return NULL;
  }

  return parse_json_get_object_string (out, "type", 0,
                                       __func__, "ldmtool show volume");
}