diff mbox

[2/3] uefirttime: print out the return status and description when errors occur

Message ID 1355478585-25430-1-git-send-email-ivan.hu@canonical.com
State Accepted
Headers show

Commit Message

Ivan Hu Dec. 14, 2012, 9:49 a.m. UTC
When errors occur for UEFI runtime service interface, print out the useful
reports to user.

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 src/uefi/uefirttime/uefirttime.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Colin Ian King Dec. 14, 2012, 10:30 a.m. UTC | #1
On 14/12/12 09:49, Ivan Hu wrote:
> When errors occur for UEFI runtime service interface, print out the useful
> reports to user.
>
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>   src/uefi/uefirttime/uefirttime.c |   11 +++++++++++
>   1 file changed, 11 insertions(+)
>
> diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c
> index e557619..78b5a3b 100644
> --- a/src/uefi/uefirttime/uefirttime.c
> +++ b/src/uefi/uefirttime/uefirttime.c
> @@ -212,6 +212,7 @@ static int uefirttime_test1(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime",
>   			"Failed to get time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
> @@ -244,6 +245,7 @@ static int uefirttime_test2(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime",
>   			"Failed to get time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
> @@ -280,6 +282,7 @@ static int uefirttime_test2(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetTime",
>   			"Failed to set time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
> @@ -292,6 +295,7 @@ static int uefirttime_test2(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime",
>   			"Failed to get time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
> @@ -331,6 +335,7 @@ static int uefirttime_test2(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetTime",
>   			"Failed to set time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
> @@ -356,6 +361,7 @@ static int uefirttime_test3(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime",
>   			"Failed to get wakeup time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
> @@ -391,6 +397,7 @@ static int uefirttime_test4(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime",
>   			"Failed to get time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
> @@ -405,6 +412,7 @@ static int uefirttime_test4(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetWakeupTime",
>   			"Failed to set wakeup time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
> @@ -419,6 +427,7 @@ static int uefirttime_test4(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime",
>   			"Failed to get wakeup time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
> @@ -447,6 +456,7 @@ static int uefirttime_test4(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetWakeupTime",
>   			"Failed to set wakeup time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
> @@ -456,6 +466,7 @@ static int uefirttime_test4(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime",
>   			"Failed to get wakeup time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
>

Looks good.

Acked-by: Colin Ian King <colin.king@canonical.com>
Alex Hung Dec. 21, 2012, 2:01 a.m. UTC | #2
On 12/14/2012 05:49 PM, Ivan Hu wrote:
> When errors occur for UEFI runtime service interface, print out the useful
> reports to user.
>
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>   src/uefi/uefirttime/uefirttime.c |   11 +++++++++++
>   1 file changed, 11 insertions(+)
>
> diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c
> index e557619..78b5a3b 100644
> --- a/src/uefi/uefirttime/uefirttime.c
> +++ b/src/uefi/uefirttime/uefirttime.c
> @@ -212,6 +212,7 @@ static int uefirttime_test1(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime",
>   			"Failed to get time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
> @@ -244,6 +245,7 @@ static int uefirttime_test2(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime",
>   			"Failed to get time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
> @@ -280,6 +282,7 @@ static int uefirttime_test2(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetTime",
>   			"Failed to set time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
> @@ -292,6 +295,7 @@ static int uefirttime_test2(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime",
>   			"Failed to get time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
> @@ -331,6 +335,7 @@ static int uefirttime_test2(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetTime",
>   			"Failed to set time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
> @@ -356,6 +361,7 @@ static int uefirttime_test3(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime",
>   			"Failed to get wakeup time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
> @@ -391,6 +397,7 @@ static int uefirttime_test4(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime",
>   			"Failed to get time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
> @@ -405,6 +412,7 @@ static int uefirttime_test4(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetWakeupTime",
>   			"Failed to set wakeup time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
> @@ -419,6 +427,7 @@ static int uefirttime_test4(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime",
>   			"Failed to get wakeup time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
> @@ -447,6 +456,7 @@ static int uefirttime_test4(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetWakeupTime",
>   			"Failed to set wakeup time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
> @@ -456,6 +466,7 @@ static int uefirttime_test4(fwts_framework *fw)
>   	if (ioret == -1) {
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime",
>   			"Failed to get wakeup time with UEFI runtime service.");
> +		fwts_uefi_print_status_info(fw, status);
>   		return FWTS_ERROR;
>   	}
>
>
Acked-by: Alex Hung <alex.hung@canonical.com>
diff mbox

Patch

diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c
index e557619..78b5a3b 100644
--- a/src/uefi/uefirttime/uefirttime.c
+++ b/src/uefi/uefirttime/uefirttime.c
@@ -212,6 +212,7 @@  static int uefirttime_test1(fwts_framework *fw)
 	if (ioret == -1) {
 		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime",
 			"Failed to get time with UEFI runtime service.");
+		fwts_uefi_print_status_info(fw, status);
 		return FWTS_ERROR;
 	}
 
@@ -244,6 +245,7 @@  static int uefirttime_test2(fwts_framework *fw)
 	if (ioret == -1) {
 		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime",
 			"Failed to get time with UEFI runtime service.");
+		fwts_uefi_print_status_info(fw, status);
 		return FWTS_ERROR;
 	}
 
@@ -280,6 +282,7 @@  static int uefirttime_test2(fwts_framework *fw)
 	if (ioret == -1) {
 		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetTime",
 			"Failed to set time with UEFI runtime service.");
+		fwts_uefi_print_status_info(fw, status);
 		return FWTS_ERROR;
 	}
 
@@ -292,6 +295,7 @@  static int uefirttime_test2(fwts_framework *fw)
 	if (ioret == -1) {
 		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime",
 			"Failed to get time with UEFI runtime service.");
+		fwts_uefi_print_status_info(fw, status);
 		return FWTS_ERROR;
 	}
 
@@ -331,6 +335,7 @@  static int uefirttime_test2(fwts_framework *fw)
 	if (ioret == -1) {
 		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetTime",
 			"Failed to set time with UEFI runtime service.");
+		fwts_uefi_print_status_info(fw, status);
 		return FWTS_ERROR;
 	}
 
@@ -356,6 +361,7 @@  static int uefirttime_test3(fwts_framework *fw)
 	if (ioret == -1) {
 		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime",
 			"Failed to get wakeup time with UEFI runtime service.");
+		fwts_uefi_print_status_info(fw, status);
 		return FWTS_ERROR;
 	}
 
@@ -391,6 +397,7 @@  static int uefirttime_test4(fwts_framework *fw)
 	if (ioret == -1) {
 		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime",
 			"Failed to get time with UEFI runtime service.");
+		fwts_uefi_print_status_info(fw, status);
 		return FWTS_ERROR;
 	}
 
@@ -405,6 +412,7 @@  static int uefirttime_test4(fwts_framework *fw)
 	if (ioret == -1) {
 		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetWakeupTime",
 			"Failed to set wakeup time with UEFI runtime service.");
+		fwts_uefi_print_status_info(fw, status);
 		return FWTS_ERROR;
 	}
 
@@ -419,6 +427,7 @@  static int uefirttime_test4(fwts_framework *fw)
 	if (ioret == -1) {
 		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime",
 			"Failed to get wakeup time with UEFI runtime service.");
+		fwts_uefi_print_status_info(fw, status);
 		return FWTS_ERROR;
 	}
 
@@ -447,6 +456,7 @@  static int uefirttime_test4(fwts_framework *fw)
 	if (ioret == -1) {
 		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetWakeupTime",
 			"Failed to set wakeup time with UEFI runtime service.");
+		fwts_uefi_print_status_info(fw, status);
 		return FWTS_ERROR;
 	}
 
@@ -456,6 +466,7 @@  static int uefirttime_test4(fwts_framework *fw)
 	if (ioret == -1) {
 		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime",
 			"Failed to get wakeup time with UEFI runtime service.");
+		fwts_uefi_print_status_info(fw, status);
 		return FWTS_ERROR;
 	}