mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-27 07:22:07 +03:00
util: Check/ignore already disabled event
If the event is already disabled, then don't bother with setting it disabled again. Causes unnecessary error on systems that don't support the feature anyway.
This commit is contained in:
parent
12b2aebeba
commit
0f3f8ac97e
@ -234,6 +234,9 @@ virPerfEventDisable(virPerfPtr perf,
|
||||
if (event == NULL)
|
||||
return -1;
|
||||
|
||||
if (!event->enabled)
|
||||
return 0;
|
||||
|
||||
if (ioctl(event->fd, PERF_EVENT_IOC_DISABLE) < 0) {
|
||||
virReportSystemError(errno,
|
||||
_("unable to disable host cpu perf event for %s"),
|
||||
|
Loading…
Reference in New Issue
Block a user