提交 e08479ef 编写于 作者: P Peter Krempa

qemu: perf: Don't ignore perf setup if allocation fails

Reject the VM startup if the perf event structure can't be allocated.
上级 662862ec
......@@ -5410,12 +5410,12 @@ qemuProcessLaunch(virConnectPtr conn,
if (qemuSetupCgroup(driver, vm, nnicindexes, nicindexes) < 0)
goto cleanup;
priv->perf = virPerfNew();
if (priv->perf) {
for (i = 0; i < VIR_PERF_EVENT_LAST; i++) {
if (vm->def->perf->events[i] == VIR_TRISTATE_BOOL_YES)
virPerfEventEnable(priv->perf, i, vm->pid);
}
if (!(priv->perf = virPerfNew()))
goto cleanup;
for (i = 0; i < VIR_PERF_EVENT_LAST; i++) {
if (vm->def->perf->events[i] == VIR_TRISTATE_BOOL_YES)
virPerfEventEnable(priv->perf, i, vm->pid);
}
/* This must be done after cgroup placement to avoid resetting CPU
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册