[libvirt] [PATCH 25/32] node_device_udev: switch to using virReportError

Peter Krempa pkrempa at redhat.com
Mon Jun 6 12:50:34 UTC 2016


On Mon, Jun 06, 2016 at 11:02:02 +0200, Ján Tomko wrote:
> Also use the more common "Unable to initialize mutex" string
> and virReportSystemError instead of virStrerror.
> ---
>  src/node_device/node_device_udev.c | 47 +++++++++++++++++++++++---------------
>  1 file changed, 28 insertions(+), 19 deletions(-)
> 
> diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
> index 54eb319..8307b80 100644
> --- a/src/node_device/node_device_udev.c
> +++ b/src/node_device/node_device_udev.c

[...]

> @@ -1212,7 +1219,7 @@ static int udevEnumerateDevices(struct udev *udev)
>  
>      ret = udev_enumerate_scan_devices(udev_enumerate);
>      if (0 != ret) {
> -        VIR_ERROR(_("udev scan devices returned %d"), ret);
> +        virReportError(VIR_ERR_INTERNAL_ERROR, _("udev scan devices returned %d"), ret);

Resulting line is too long.

>          goto out;
>      }
>  
> @@ -1292,14 +1299,15 @@ static void udevEventHandleCallback(int watch ATTRIBUTE_UNUSED,
>      nodeDeviceLock();
>      udev_fd = udev_monitor_get_fd(udev_monitor);
>      if (fd != udev_fd) {
> -        VIR_ERROR(_("File descriptor returned by udev %d does not "
> +        virReportError(VIR_ERR_INTERNAL_ERROR, _("File descriptor returned by udev %d does not "
>                      "match node device file descriptor %d"), fd, udev_fd);

Resulting line is too long and formatting is broken.

>          goto out;
>      }
>  
>      device = udev_monitor_receive_device(udev_monitor);
>      if (device == NULL) {
> -        VIR_ERROR(_("udev_monitor_receive_device returned NULL"));
> +        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> +                       _("udev_monitor_receive_device returned NULL"));
>          goto out;
>      }
>  
> @@ -1337,7 +1345,7 @@ udevGetDMIData(virNodeDevCapDataPtr data)
>      if (device == NULL) {
>          device = udev_device_new_from_syspath(udev, DMI_DEVPATH_FALLBACK);
>          if (device == NULL) {
> -            VIR_ERROR(_("Failed to get udev device for syspath '%s' or '%s'"),
> +            virReportError(VIR_ERR_INTERNAL_ERROR, _("Failed to get udev device for syspath '%s' or '%s'"),
>                        DMI_DEVPATH, DMI_DEVPATH_FALLBACK);

Too long and broken too.

>              goto out;
>          }

ACK with the defects fixed.




More information about the libvir-list mailing list