Adjust some log levels in udev driver

Most of te VIR_INFO calls in the udev driver are only relevant
to developers so can switch to VIR_DEBUG. Failure to initialize
libpciaccess though is a fatal error

* src/node_device/node_device_udev.c: Adjust log levels
This commit is contained in:
Daniel P. Berrange 2011-02-09 16:41:30 +00:00
parent bf6a3825b5
commit 7a4bc156c1

View File

@ -116,8 +116,8 @@ static int udevGetDeviceProperty(struct udev_device *udev_device,
udev_value = udev_device_get_property_value(udev_device, property_key); udev_value = udev_device_get_property_value(udev_device, property_key);
if (udev_value == NULL) { if (udev_value == NULL) {
VIR_INFO(_("udev reports device '%s' does not have property '%s'"), VIR_DEBUG("udev reports device '%s' does not have property '%s'",
udev_device_get_sysname(udev_device), property_key); udev_device_get_sysname(udev_device), property_key);
ret = PROPERTY_MISSING; ret = PROPERTY_MISSING;
goto out; goto out;
} }
@ -205,8 +205,8 @@ static int udevGetDeviceSysfsAttr(struct udev_device *udev_device,
udev_value = udev_device_get_sysattr_value(udev_device, attr_name); udev_value = udev_device_get_sysattr_value(udev_device, attr_name);
if (udev_value == NULL) { if (udev_value == NULL) {
VIR_INFO(_("udev reports device '%s' does not have sysfs attr '%s'"), VIR_DEBUG("udev reports device '%s' does not have sysfs attr '%s'",
udev_device_get_sysname(udev_device), attr_name); udev_device_get_sysname(udev_device), attr_name);
ret = PROPERTY_MISSING; ret = PROPERTY_MISSING;
goto out; goto out;
} }
@ -950,9 +950,9 @@ static int udevKludgeStorageType(virNodeDeviceDefPtr def)
{ {
int ret = -1; int ret = -1;
VIR_INFO("Could not find definitive storage type for device " VIR_DEBUG("Could not find definitive storage type for device "
"with sysfs path '%s', trying to guess it", "with sysfs path '%s', trying to guess it",
def->sysfs_path); def->sysfs_path);
if (STRPREFIX(def->caps->data.storage.block, "/dev/vd")) { if (STRPREFIX(def->caps->data.storage.block, "/dev/vd")) {
/* virtio disk */ /* virtio disk */
@ -963,8 +963,8 @@ static int udevKludgeStorageType(virNodeDeviceDefPtr def)
} }
if (ret != 0) { if (ret != 0) {
VIR_INFO("Could not determine storage type for device " VIR_DEBUG("Could not determine storage type for device "
"with sysfs path '%s'", def->sysfs_path); "with sysfs path '%s'", def->sysfs_path);
} else { } else {
VIR_DEBUG("Found storage type '%s' for device " VIR_DEBUG("Found storage type '%s' for device "
"with sysfs path '%s'", "with sysfs path '%s'",
@ -1062,8 +1062,8 @@ static int udevProcessStorage(struct udev_device *device,
} else if (STREQ(def->caps->data.storage.drive_type, "floppy")) { } else if (STREQ(def->caps->data.storage.drive_type, "floppy")) {
ret = udevProcessFloppy(device, def); ret = udevProcessFloppy(device, def);
} else { } else {
VIR_INFO("Unsupported storage type '%s'", VIR_DEBUG("Unsupported storage type '%s'",
def->caps->data.storage.drive_type); def->caps->data.storage.drive_type);
goto out; goto out;
} }
@ -1141,9 +1141,9 @@ static int udevGetDeviceType(struct udev_device *device,
goto out; goto out;
} }
VIR_INFO("Could not determine device type for device " VIR_DEBUG("Could not determine device type for device "
"with sysfs path '%s'", "with sysfs path '%s'",
udev_device_get_sysname(device)); udev_device_get_sysname(device));
ret = -1; ret = -1;
out: out:
@ -1209,8 +1209,8 @@ static int udevRemoveOneDevice(struct udev_device *device)
dev->def->name, name); dev->def->name, name);
virNodeDeviceObjRemove(&driverState->devs, dev); virNodeDeviceObjRemove(&driverState->devs, dev);
} else { } else {
VIR_INFO("Failed to find device to remove that has udev name '%s'", VIR_DEBUG("Failed to find device to remove that has udev name '%s'",
name); name);
ret = -1; ret = -1;
} }
nodeDeviceUnlock(driverState); nodeDeviceUnlock(driverState);
@ -1237,8 +1237,8 @@ static int udevSetParent(struct udev_device *device,
parent_sysfs_path = udev_device_get_syspath(parent_device); parent_sysfs_path = udev_device_get_syspath(parent_device);
if (parent_sysfs_path == NULL) { if (parent_sysfs_path == NULL) {
VIR_INFO("Could not get syspath for parent of '%s'", VIR_DEBUG("Could not get syspath for parent of '%s'",
udev_device_get_syspath(parent_device)); udev_device_get_syspath(parent_device));
} }
dev = virNodeDeviceFindBySysfsPath(&driverState->devs, dev = virNodeDeviceFindBySysfsPath(&driverState->devs,
@ -1350,8 +1350,8 @@ static int udevProcessDeviceListEntry(struct udev *udev,
if (device != NULL) { if (device != NULL) {
if (udevAddOneDevice(device) != 0) { if (udevAddOneDevice(device) != 0) {
VIR_INFO("Failed to create node device for udev device '%s'", VIR_DEBUG("Failed to create node device for udev device '%s'",
name); name);
} }
ret = 0; ret = 0;
} }
@ -1598,8 +1598,8 @@ static int udevDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
if ((pciret = pci_system_init()) != 0) { if ((pciret = pci_system_init()) != 0) {
char ebuf[256]; char ebuf[256];
VIR_INFO("Failed to initialize libpciaccess: %s", VIR_ERROR(_("Failed to initialize libpciaccess: %s"),
virStrerror(pciret, ebuf, sizeof ebuf)); virStrerror(pciret, ebuf, sizeof ebuf));
ret = -1; ret = -1;
goto out; goto out;
} }