From 72dbac04484eae169fd12e94eadce4c7a01f378c Mon Sep 17 00:00:00 2001 From: Sun Peng Date: Thu, 27 Aug 2020 12:58:29 +0000 Subject: [PATCH] dm: ahci: Convert print output to acrn-dm logger Unifies the logs to pr_* interfaces instead of printf for better log management. Tracked-On: #5267 Signed-off-by: Sun Peng Reviewed-by: Chi Mingqiang Acked-by: Wang, Yu1 --- devicemodel/hw/pci/ahci.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/devicemodel/hw/pci/ahci.c b/devicemodel/hw/pci/ahci.c index b5c89db1b..56a7bf521 100644 --- a/devicemodel/hw/pci/ahci.c +++ b/devicemodel/hw/pci/ahci.c @@ -93,14 +93,11 @@ enum sata_fis_type { * Debug printf */ #ifdef AHCI_DEBUG -static FILE *dbg; -#define DPRINTF(format, arg...) do { fprintf(dbg, format, ##arg); \ - fflush(dbg); } \ - while (0) +#define DPRINTF(format, arg...) do { pr_dbg(format, ##arg); } while (0) #else #define DPRINTF(format, arg...) #endif -#define WPRINTF(format, arg...) printf(format, ##arg) +#define WPRINTF(format, arg...) pr_err(format, ##arg) struct ahci_ioreq { struct blockif_req io_req; @@ -2352,9 +2349,6 @@ pci_ahci_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts, int atapi) ret = 0; #define MAX_OPTS_LEN 256 -#ifdef AHCI_DEBUG - dbg = fopen("/tmp/log", "w+"); -#endif ahci_dev = calloc(1, sizeof(struct pci_ahci_vdev)); if (!ahci_dev) {