提交 5a217e84 编写于 作者: D Daniel P. Berrange

Convert nodeGetInfo to virArch APIs

Replace use of uname in nodeGetInfo with virArch APIs to
provide canonicalization of host architecture name
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 03331801
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include "virterror_internal.h" #include "virterror_internal.h"
#include "count-one-bits.h" #include "count-one-bits.h"
#include "intprops.h" #include "intprops.h"
#include "virarch.h"
#include "virfile.h" #include "virfile.h"
#include "virtypedparam.h" #include "virtypedparam.h"
...@@ -841,13 +842,11 @@ error: ...@@ -841,13 +842,11 @@ error:
} }
#endif #endif
int nodeGetInfo(virConnectPtr conn ATTRIBUTE_UNUSED, virNodeInfoPtr nodeinfo) { int nodeGetInfo(virConnectPtr conn ATTRIBUTE_UNUSED, virNodeInfoPtr nodeinfo)
struct utsname info; {
virArch hostarch = virArchFromHost();
memset(nodeinfo, 0, sizeof(*nodeinfo));
uname(&info);
if (virStrcpyStatic(nodeinfo->model, info.machine) == NULL) if (virStrcpyStatic(nodeinfo->model, virArchToString(hostarch)) == NULL)
return -1; return -1;
#ifdef __linux__ #ifdef __linux__
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册