mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
virPCIDeviceHasVPD: Refactor "debug" messages
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@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
9aa303a948
commit
3ca1079318
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user