Dominique Leuenberger 2023-02-18 16:10:18 +00:00 committed by Git OBS Bridge
commit 2928d2c820
3 changed files with 57 additions and 8 deletions

View File

@ -37,9 +37,9 @@ enum datatypes {
#define WITHOUT_KEY 0 #define WITHOUT_KEY 0
#define WITH_KEY 1 #define WITH_KEY 1
static char *versionstring = "Version 1.0.2 2020-03-30 23:30"; static char *versionstring = "Version 1.0.3 2023-02-16 17:00";
static char *version = "1.0.2"; static char *version = "1.0.3";
void *configuration_handle = NULL; void *configuration_handle = NULL;
int layers = -1; int layers = -1;
@ -339,12 +339,47 @@ return;
/* */ /* */
/* print out the uuid for this machine */ /* print out the uuid for this machine */
/* */ /* */
/* TODO! */ /* */
/* */ /* */
/******************************************************************************/ /******************************************************************************/
void print_uuid() int print_uuid()
{ {
return; const char *result_string = NULL;
int erg;
erg = qc_get_attribute_string(configuration_handle, qc_sequence_code, 0, &result_string);
if (erg != 1)
{
puts("Error reading the Serial Number");
return 1;
}
printf("%s", result_string);
result_string = NULL;
erg = qc_get_attribute_string(configuration_handle, qc_layer_name, 1, &result_string);
if (erg != 1)
{
puts("Error reading the LPAR Name");
return 1;
}
printf("-%s", result_string);
result_string = NULL;
if (layers > 2) {
erg = qc_get_attribute_string(configuration_handle, qc_layer_name, 3, &result_string);
if (erg != 1)
{
puts("Error Reading the VM Name");
return 1;
}
printf("-%s", result_string);
result_string = NULL;
}
printf("\n", result_string);
return 0;
} /* print_uuid */ } /* print_uuid */
/******************************************************************************/ /******************************************************************************/
@ -501,7 +536,7 @@ void *configuration_handle_tmp = NULL;
return 1; return 1;
} /* endif */ } /* endif */
/* still not im[plemented thatfore set to zero */ /* still not im[plemented thatfore set to zero */
create_uuid = list_attr = print_attr = 0; list_attr = print_attr = 0;
if (print_attr != 0) { if (print_attr != 0) {
print_user_attribute(NULL, print_attribute_param, layers); print_user_attribute(NULL, print_attribute_param, layers);
goto main_exit; goto main_exit;
@ -523,7 +558,9 @@ void *configuration_handle_tmp = NULL;
goto main_exit; goto main_exit;
} /* endif */ } /* endif */
if (create_uuid != 0) { if (create_uuid != 0) {
print_uuid(); if(print_uuid() == 1){
goto main_exit_error;
}
goto main_exit; goto main_exit;
} /* endif */ } /* endif */
help(); help();
@ -535,5 +572,9 @@ main_exit:
setenv("QC_AUTODUMP", "0", 1); setenv("QC_AUTODUMP", "0", 1);
qc_close(configuration_handle_tmp); qc_close(configuration_handle_tmp);
} /* endif */ } /* endif */
return 0; return 0;
main_exit_error:
return 1;
} /* end main */ } /* end main */

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Thu Feb 16 16:24:33 UTC 2023 - José Gómez <jose.gomez@suse.com>
- Implemented read_values -u. The result of -u is a unique identifier composed of:
* Machine Serial Number.
* LPAR Name.
* VM Name (can be optional).
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Feb 6 17:00:40 UTC 2023 - Nikolay Gueorguiev <nikolay.gueorguiev@suse.com> Mon Feb 6 17:00:40 UTC 2023 - Nikolay Gueorguiev <nikolay.gueorguiev@suse.com>

View File

@ -1,7 +1,7 @@
# #
# spec file for package s390-tools # spec file for package s390-tools
# #
# Copyright (c) 2001-2023 SUSE LLC # Copyright (c) 2023 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed