Re: [PATCH 3/8] nodeinfo: Cleanup improper VIR_ERR_NO_SUPPORT use

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

 



On Thu, Sep 01, 2011 at 02:42:51PM +0800, Osier Yang wrote:
> 于 2011年08月25日 05:48, Daniel P. Berrange 写道:
> >On Tue, Aug 23, 2011 at 05:39:40PM +0800, Osier Yang wrote:
> >>---
> >>  src/nodeinfo.c |   16 ++++++++--------
> >>  1 files changed, 8 insertions(+), 8 deletions(-)
> >>
> >>diff --git a/src/nodeinfo.c b/src/nodeinfo.c
> >>index cae2564..b21e555 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_NO_SUPPORT, "%s",
> >>+    nodeReportError(VIR_ERR_OPERATION_INVALID, "%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_NO_SUPPORT, "%s",
> >>+    nodeReportError(VIR_ERR_OPERATION_INVALID, "%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_NO_SUPPORT,
> >>+                nodeReportError(VIR_ERR_OPERATION_INVALID,
> 
> Hi, Daniel
> 
> I think VIR_ERR_NO_SUPPORT is not correct, as the function is
> neither a no-op stub
> and not implemented. But per your explaination on [patch 0/8],
> OPERATION_INVALID
> is not proper here too. Change it into INTERNAL_ERROR.

Yeah, ok.


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]