#include "virfile.h"
#include "vircommand.h"
#include "virstring.h"
+#include "virhostcpu.h"
#define VIR_FROM_THIS VIR_FROM_OPENVZ
}
if (ret == 0 || vcpus == 0)
- vcpus = openvzGetNodeCPUs();
+ vcpus = virHostCPUGetCount();
if (virDomainDefSetVcpusMax(def, vcpus, driver->xmlopt) < 0)
goto cleanup;
return -1;
}
-unsigned int
-openvzGetNodeCPUs(void)
-{
- virNodeInfo nodeinfo;
-
- if (nodeGetInfo(&nodeinfo) < 0)
- return 0;
-
- return nodeinfo.cpus;
-}
-
static int
openvzWriteConfigParam(const char * conf_file, const char *param, const char *value)
{
void openvzFreeDriver(struct openvz_driver *driver);
int strtoI(const char *str);
int openvzSetDefinedUUID(int vpsid, unsigned char *uuid);
-unsigned int openvzGetNodeCPUs(void);
int openvzGetVEID(const char *name);
int openvzReadNetworkConf(virDomainDefPtr def, int veid);
const char *prog[] = { VZCTL, "--quiet", "set", PROGRAM_SENTINEL,
"--cpus", str_vcpus, "--save", NULL };
unsigned int pcpus;
- pcpus = openvzGetNodeCPUs();
+ pcpus = virHostCPUGetCount();
if (pcpus > 0 && pcpus < nvcpus)
nvcpus = pcpus;