mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
Convert nodeGetInfo to virArch APIs
Replace use of uname in nodeGetInfo with virArch APIs to provide canonicalization of host architecture name Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
0333180185
commit
5a217e84c4
@ -47,6 +47,7 @@
|
||||
#include "virterror_internal.h"
|
||||
#include "count-one-bits.h"
|
||||
#include "intprops.h"
|
||||
#include "virarch.h"
|
||||
#include "virfile.h"
|
||||
#include "virtypedparam.h"
|
||||
|
||||
@ -841,13 +842,11 @@ error:
|
||||
}
|
||||
#endif
|
||||
|
||||
int nodeGetInfo(virConnectPtr conn ATTRIBUTE_UNUSED, virNodeInfoPtr nodeinfo) {
|
||||
struct utsname info;
|
||||
int nodeGetInfo(virConnectPtr conn ATTRIBUTE_UNUSED, virNodeInfoPtr nodeinfo)
|
||||
{
|
||||
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;
|
||||
|
||||
#ifdef __linux__
|
||||
|
Loading…
x
Reference in New Issue
Block a user