dm:replace perror with pr_err

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

Tracked-On: #4098
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
This commit is contained in:
Mingqiang Chi
2020-01-06 16:08:46 +08:00
committed by wenlingz
parent 0e47f0a8f9
commit 5267a9775c
10 changed files with 45 additions and 44 deletions

View File

@@ -133,7 +133,7 @@ int create_mmio_rsvd_rgn(uint64_t start,
int i;
if(bar_type == PCIBAR_IO){
perror("fail to create PCIBAR_IO bar_type\n");
pr_err("fail to create PCIBAR_IO bar_type\n");
return -1;
}
@@ -154,7 +154,7 @@ int create_mmio_rsvd_rgn(uint64_t start,
}
}
perror("reserved_bar_regions is overflow\n");
pr_err("reserved_bar_regions is overflow\n");
return -1;
}

View File

@@ -106,7 +106,7 @@ update_gvt_bar(struct vmctx *ctx)
bar_fd = open(bar_path, O_RDONLY);
if(bar_fd == -1){
perror("failed to open sys bar info\n");
pr_err("failed to open sys bar info\n");
return;
}
@@ -115,7 +115,7 @@ update_gvt_bar(struct vmctx *ctx)
close(bar_fd);
if (ret < 76) {
perror("failed to read sys bar info\n");
pr_err("failed to read sys bar info\n");
return;
}
@@ -174,7 +174,7 @@ gvt_init_config(struct pci_gvt *gvt)
gvt->addr.function);
res_fd = open(res_name, O_RDONLY);
if (res_fd == -1) {
perror("gvt:open host pci resource failed\n");
pr_err("gvt:open host pci resource failed\n");
return -1;
}
@@ -183,7 +183,7 @@ gvt_init_config(struct pci_gvt *gvt)
close(res_fd);
if (ret < 512) {
perror("failed to read host device resource space\n");
pr_err("failed to read host device resource space\n");
return -1;
}
@@ -201,7 +201,7 @@ gvt_init_config(struct pci_gvt *gvt)
|| bar2_start_addr < ctx->lowmem_limit
|| bar0_end_addr > PCI_EMUL_ECFG_BASE
|| bar2_end_addr > PCI_EMUL_ECFG_BASE){
perror("gvt pci bases are out of range\n");
pr_err("gvt pci bases are out of range\n");
return -1;
}
@@ -225,7 +225,7 @@ gvt_init_config(struct pci_gvt *gvt)
gvt->addr.function);
gvt->host_config_fd = open(name, O_RDONLY);
if (gvt->host_config_fd == -1) {
perror("gvt:open host pci config failed\n");
pr_err("gvt:open host pci config failed\n");
return -1;
}
@@ -234,7 +234,7 @@ gvt_init_config(struct pci_gvt *gvt)
close(gvt->host_config_fd);
if (ret <= PCI_REGMAX) {
perror("failed to read host device config space\n");
pr_err("failed to read host device config space\n");
return -1;
}
@@ -368,7 +368,7 @@ pci_gvt_init(struct vmctx *ctx, struct pci_vdev *pi, char *opts)
gvt = calloc(1, sizeof(struct pci_gvt));
if (!gvt) {
perror("gvt:calloc gvt failed\n");
pr_err("gvt:calloc gvt failed\n");
return -1;
}
@@ -396,7 +396,7 @@ pci_gvt_init(struct vmctx *ctx, struct pci_vdev *pi, char *opts)
fail:
gvt_dev = NULL;
ctx->gvt_enabled = false;
perror("GVT: init failed\n");
pr_err("GVT: init failed\n");
free(gvt);
return -1;
}

View File

@@ -471,7 +471,7 @@ virtio_blk_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
} else {
bctxt = blockif_open(opts, bident);
if (bctxt == NULL) {
perror("Could not open backing file");
pr_err("Could not open backing file");
return -1;
}
}

View File

@@ -187,7 +187,7 @@ start_wdt_timer(void)
timer_val.it_value.tv_sec = seconds;
if (acrn_timer_settime(&wdt_state.timer, &timer_val) == -1) {
perror("WDT timerfd_settime failed.\n");
pr_err("WDT timerfd_settime failed.\n");
wdt_state.wdt_armed = false;
return;
}
@@ -331,7 +331,7 @@ pci_wdt_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
{
/*the wdt just has one inistance */
if (wdt_state.reboot_enabled && wdt_state.timer1_val) {
perror("wdt can't be initialized twice, please check!");
pr_err("wdt can't be initialized twice, please check!");
return -1;
}