mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: perf: Don't ignore perf setup if allocation fails
Reject the VM startup if the perf event structure can't be allocated.
This commit is contained in:
parent
662862ec5f
commit
e08479efca
@ -5410,12 +5410,12 @@ qemuProcessLaunch(virConnectPtr conn,
|
|||||||
if (qemuSetupCgroup(driver, vm, nnicindexes, nicindexes) < 0)
|
if (qemuSetupCgroup(driver, vm, nnicindexes, nicindexes) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
priv->perf = virPerfNew();
|
if (!(priv->perf = virPerfNew()))
|
||||||
if (priv->perf) {
|
goto cleanup;
|
||||||
for (i = 0; i < VIR_PERF_EVENT_LAST; i++) {
|
|
||||||
if (vm->def->perf->events[i] == VIR_TRISTATE_BOOL_YES)
|
for (i = 0; i < VIR_PERF_EVENT_LAST; i++) {
|
||||||
virPerfEventEnable(priv->perf, i, vm->pid);
|
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
|
/* This must be done after cgroup placement to avoid resetting CPU
|
||||||
|
Loading…
Reference in New Issue
Block a user