dm:use acrn-dm logger function instread of fprintf

use acrn-dm logger function instread of fprintf,
this helps the stability testing log capture.

Tracked-On: #4098
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Cao Minggui <minggui.cao@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
Mingqiang Chi
2019-11-13 14:20:36 +08:00
committed by wenlingz
parent 5375a1613b
commit a59205f6a2
24 changed files with 168 additions and 227 deletions

View File

@@ -118,8 +118,7 @@ acrn_prepare_ovmf(struct vmctx *ctx)
fp = fopen(ovmf_path, "r");
if (fp == NULL) {
fprintf(stderr,
"SW_LOAD ERR: could not open ovmf file: %s\n",
pr_err("SW_LOAD ERR: could not open ovmf file: %s\n",
ovmf_path);
return -1;
}
@@ -127,8 +126,7 @@ acrn_prepare_ovmf(struct vmctx *ctx)
fseek(fp, 0, SEEK_END);
if (ftell(fp) != ovmf_size) {
fprintf(stderr,
"SW_LOAD ERR: ovmf file changed\n");
pr_err("SW_LOAD ERR: ovmf file changed\n");
fclose(fp);
return -1;
}
@@ -138,14 +136,13 @@ acrn_prepare_ovmf(struct vmctx *ctx)
sizeof(char), ovmf_size, fp);
if (read < ovmf_size) {
fprintf(stderr,
"SW_LOAD ERR: could not read whole partition blob\n");
pr_err("SW_LOAD ERR: could not read whole partition blob\n");
fclose(fp);
return -1;
}
fclose(fp);
printf("SW_LOAD: partition blob %s size %lu copy to guest 0x%lx\n",
pr_info("SW_LOAD: partition blob %s size %lu copy to guest 0x%lx\n",
ovmf_path, ovmf_size, OVMF_TOP(ctx) - ovmf_size);
return 0;
}
@@ -176,7 +173,7 @@ acrn_sw_load_ovmf(struct vmctx *ctx)
strncpy(e820->signature, "820", sizeof(e820->signature));
e820->nentries = acrn_create_e820_table(ctx, e820->map);
printf("SW_LOAD: ovmf_entry 0x%lx\n", OVMF_TOP(ctx) - 16);
pr_info("SW_LOAD: ovmf_entry 0x%lx\n", OVMF_TOP(ctx) - 16);
/* set guest bsp state. Will call hypercall set bsp state
* after bsp is created.
@@ -213,8 +210,7 @@ acrn_writeback_ovmf_nvstorage(struct vmctx *ctx)
fp = fopen(ovmf_path, "r+");
if (fp == NULL) {
fprintf(stderr,
"OVMF_WRITEBACK ERR: could not open ovmf file: %s\n",
pr_err("OVMF_WRITEBACK ERR: could not open ovmf file: %s\n",
ovmf_path);
return -1;
}
@@ -222,8 +218,7 @@ acrn_writeback_ovmf_nvstorage(struct vmctx *ctx)
fseek(fp, 0, SEEK_END);
if (ftell(fp) != ovmf_size) {
fprintf(stderr,
"SW_LOAD ERR: ovmf file changed\n");
pr_err("SW_LOAD ERR: ovmf file changed\n");
fclose(fp);
return -1;
}
@@ -233,8 +228,7 @@ acrn_writeback_ovmf_nvstorage(struct vmctx *ctx)
sizeof(char), OVMF_NVSTORAGE_SZ, fp);
if (write < OVMF_NVSTORAGE_SZ) {
fprintf(stderr,
"OVMF_WRITEBACK ERR: could not write back OVMF\n");
pr_err("OVMF_WRITEBACK ERR: could not write back OVMF\n");
fclose(fp);
return -1;
}