[PATCH 21/31] virPCIDeviceHasVPD: Refactor "debug" messages

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

 



A checker function should not raise VIR_INFO or VIR_WARN messages
especially if they contain information useful only for debugging.

Turn the message into a VIR_DEBUG with universal meaning.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/util/virpci.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/util/virpci.c b/src/util/virpci.c
index 6c04e57038..99e6e6cbb1 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -3081,17 +3081,12 @@ virPCIGetVirtualFunctionInfo(const char *vf_sysfs_device_path,
 bool
 virPCIDeviceHasVPD(virPCIDevice *dev)
 {
-    g_autofree char *vpdPath = NULL;
+    g_autofree char *vpdPath = virPCIFile(dev->name, "vpd");
+    bool ret = virFileIsRegular(vpdPath);

-    vpdPath = virPCIFile(dev->name, "vpd");
-    if (!virFileExists(vpdPath)) {
-        VIR_INFO("Device VPD file does not exist %s", vpdPath);
-        return false;
-    } else if (!virFileIsRegular(vpdPath)) {
-        VIR_WARN("VPD path does not point to a regular file %s", vpdPath);
-        return false;
-    }
-    return true;
+    VIR_DEBUG("path='%s', exists='%d'", vpdPath, ret);
+
+    return ret;
 }

 /**
-- 
2.43.0
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux