Re: [PATCH] nodeinfo: Fix incorrect error codes

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

 



On Thu, Sep 01, 2011 at 02:45:31PM +0800, Osier Yang wrote:
> Introduced by 5e495c8b, except the ones for checking if numa
> is supported by host, all the NO_SUPPORT are changed back. For
> the ones about numa checking, change them into INTERNAL_ERROR.
> ---
>  src/nodeinfo.c |   16 ++++++++--------
>  1 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/src/nodeinfo.c b/src/nodeinfo.c
> index b21e555..6448b79 100644
> --- a/src/nodeinfo.c
> +++ b/src/nodeinfo.c
> @@ -629,7 +629,7 @@ int nodeGetInfo(virConnectPtr conn ATTRIBUTE_UNUSED, virNodeInfoPtr nodeinfo) {
>      }
>  #else
>      /* XXX Solaris will need an impl later if they port QEMU driver */
> -    nodeReportError(VIR_ERR_OPERATION_INVALID, "%s",
> +    nodeReportError(VIR_ERR_NO_SUPPORT, "%s",
>                      _("node info not implemented on this platform"));
>      return -1;
>  #endif
> @@ -658,7 +658,7 @@ int nodeGetCPUStats(virConnectPtr conn ATTRIBUTE_UNUSED,
>          return ret;
>      }
>  #else
> -    nodeReportError(VIR_ERR_OPERATION_INVALID, "%s",
> +    nodeReportError(VIR_ERR_NO_SUPPORT, "%s",
>                      _("node CPU stats not implemented on this platform"));
>      return -1;
>  #endif
> @@ -688,7 +688,7 @@ int nodeGetMemoryStats(virConnectPtr conn ATTRIBUTE_UNUSED,
>  # if HAVE_NUMACTL
>              if (numa_available() < 0) {
>  # endif
> -                nodeReportError(VIR_ERR_OPERATION_INVALID,
> +                nodeReportError(VIR_ERR_INTERNAL_ERROR,
>                                  "%s", _("NUMA not supported on this host"));
>                  return -1;
>  # if HAVE_NUMACTL
> @@ -724,7 +724,7 @@ int nodeGetMemoryStats(virConnectPtr conn ATTRIBUTE_UNUSED,
>          return ret;
>      }
>  #else
> -    nodeReportError(VIR_ERR_OPERATION_INVALID, "%s",
> +    nodeReportError(VIR_ERR_NO_SUPPORT, "%s",
>                      _("node memory stats not implemented on this platform"));
>      return -1;
>  #endif
> @@ -818,7 +818,7 @@ nodeGetCellsFreeMemory(virConnectPtr conn ATTRIBUTE_UNUSED,
>      int maxCell;
>  
>      if (numa_available() < 0) {
> -        nodeReportError(VIR_ERR_OPERATION_INVALID,
> +        nodeReportError(VIR_ERR_INTERNAL_ERROR,
>                          "%s", _("NUMA not supported on this host"));
>          goto cleanup;
>      }
> @@ -856,7 +856,7 @@ nodeGetFreeMemory(virConnectPtr conn ATTRIBUTE_UNUSED)
>      int n;
>  
>      if (numa_available() < 0) {
> -        nodeReportError(VIR_ERR_OPERATION_INVALID,
> +        nodeReportError(VIR_ERR_INTERNAL_ERROR,
>                          "%s", _("NUMA not supported on this host"));
>          goto cleanup;
>      }
> @@ -885,14 +885,14 @@ int nodeGetCellsFreeMemory(virConnectPtr conn ATTRIBUTE_UNUSED,
>                                int startCell ATTRIBUTE_UNUSED,
>                                int maxCells ATTRIBUTE_UNUSED)
>  {
> -    nodeReportError(VIR_ERR_OPERATION_INVALID, "%s",
> +    nodeReportError(VIR_ERR_NO_SUPPORT, "%s",
>                      _("NUMA memory information not available on this platform"));
>      return -1;
>  }
>  
>  unsigned long long nodeGetFreeMemory(virConnectPtr conn ATTRIBUTE_UNUSED)
>  {
> -    nodeReportError(VIR_ERR_OPERATION_INVALID, "%s",
> +    nodeReportError(VIR_ERR_NO_SUPPORT, "%s",
>                      _("NUMA memory information not available on this platform"));
>      return 0;
>  }

ACK


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[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]