提交 dfab48ac 编写于 作者: J Jiri Denemark

Implement cpuBaseline in remote and qemu drivers

上级 a3d22efd
......@@ -8509,6 +8509,19 @@ qemuCPUCompare(virConnectPtr conn,
return ret;
}
static char *
qemuCPUBaseline(virConnectPtr conn ATTRIBUTE_UNUSED,
const char **xmlCPUs,
unsigned int ncpus,
unsigned int flags ATTRIBUTE_UNUSED)
{
char *cpu;
cpu = cpuBaselineXML(xmlCPUs, ncpus, NULL, 0);
return cpu;
}
static virDriver qemuDriver = {
VIR_DRV_QEMU,
"QEMU",
......@@ -8587,7 +8600,7 @@ static virDriver qemuDriver = {
qemuDomainIsActive,
qemuDomainIsPersistent,
qemuCPUCompare, /* cpuCompare */
NULL, /* cpuBaseline */
qemuCPUBaseline, /* cpuBaseline */
};
......
......@@ -7590,6 +7590,37 @@ done:
return rv;
}
static char *
remoteCPUBaseline(virConnectPtr conn,
const char **xmlCPUs,
unsigned int ncpus,
unsigned int flags)
{
struct private_data *priv = conn->privateData;
remote_cpu_baseline_args args;
remote_cpu_baseline_ret ret;
char *cpu = NULL;
remoteDriverLock(priv);
args.xmlCPUs.xmlCPUs_len = ncpus;
args.xmlCPUs.xmlCPUs_val = (char **) xmlCPUs;
args.flags = flags;
memset(&ret, 0, sizeof (ret));
if (call(conn, priv, 0, REMOTE_PROC_CPU_BASELINE,
(xdrproc_t) xdr_remote_cpu_baseline_args, (char *) &args,
(xdrproc_t) xdr_remote_cpu_baseline_ret, (char *) &ret) == -1)
goto done;
cpu = ret.cpu;
done:
remoteDriverUnlock(priv);
return cpu;
}
/*----------------------------------------------------------------------*/
......@@ -8980,7 +9011,7 @@ static virDriver remote_driver = {
remoteDomainIsActive, /* domainIsActive */
remoteDomainIsPersistent, /* domainIsPersistent */
remoteCPUCompare, /* cpuCompare */
NULL, /* cpuBaseline */
remoteCPUBaseline, /* cpuBaseline */
};
static virNetworkDriver network_driver = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册