[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[UNIKRAFT PATCH RFCv4 27/35] plat/platform_bus,virtio_mmio: Avoid useless log storm



This is to suppress and adjust some log line level for platform bus and
virtio_mmio. E.g. ENODEV is normal when qemu doesn't create any virtio
mmio devices in the platform bus probing.

Signed-off-by: Jia He <justin.he@xxxxxxx>
---
 plat/common/platform_bus.c        | 7 +++----
 plat/drivers/virtio/virtio_mmio.c | 3 +--
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/plat/common/platform_bus.c b/plat/common/platform_bus.c
index fecb389..83d3e70 100644
--- a/plat/common/platform_bus.c
+++ b/plat/common/platform_bus.c
@@ -81,7 +81,7 @@ static inline struct pf_driver *pf_find_driver(const char 
*compatible)
                id.device_id = (uint16_t)drv->match(compatible);
                if (id.device_id) {
                        if (pf_device_id_match(&id, drv->device_ids)) {
-                               uk_pr_debug("pf driver found  devid(0x%x)\n", 
id.device_id);
+                               uk_pr_debug("pf driver found devid(0x%x)\n", 
id.device_id);
 
                                return drv;
                        }
@@ -105,8 +105,8 @@ static inline int pf_driver_add_device(struct pf_driver 
*drv,
        uk_pr_debug("pf_driver_add_device devid=%d\n", dev->id.device_id);
 
        ret = drv->add_dev(dev);
-       if (ret < 0) {
-               uk_pr_err("Platform Failed to initialize device driver\n");
+       if (ret < 0 && ret != -ENODEV) {
+               uk_pr_err("Platform Failed to initialize device driver, 
ret(%d)\n",ret);
        }
 
        return ret;
@@ -178,7 +178,6 @@ static int pf_probe(void)
 
                ret = pf_driver_add_device(drv, dev);
                if (ret < 0) {
-                       uk_pr_err("Platform Failed to initialize device driver, 
ret(%d)\n",ret);
                        uk_free(pfh.a, dev);
                }
        } while (1);
diff --git a/plat/drivers/virtio/virtio_mmio.c 
b/plat/drivers/virtio/virtio_mmio.c
index 9be07c1..be9e59d 100644
--- a/plat/drivers/virtio/virtio_mmio.c
+++ b/plat/drivers/virtio/virtio_mmio.c
@@ -442,7 +442,6 @@ static int virtio_mmio_add_dev(struct pf_device *pfdev)
        int rc;
 
        UK_ASSERT(pfdev != NULL);
-       uk_pr_info("virtio_mmio_add dev\n");
 
        vm_dev = uk_malloc(a, sizeof(*vm_dev));
        if (!vm_dev) {
@@ -483,7 +482,7 @@ static int virtio_mmio_add_dev(struct pf_device *pfdev)
                 * virtio-mmio device with an ID 0 is a (dummy) placeholder
                 * with no function. End probing now with no error reported.
                 */
-               uk_pr_err("virtio_device_id is 0\n");
+               uk_pr_info("virtio_device_id is 0\n");
 
                rc = -ENODEV;
                goto free_vmdev;
-- 
2.17.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.