]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: Quiet the logging if perf file doesn't exist
authorJohn Ferlan <jferlan@redhat.com>
Tue, 6 Sep 2016 21:20:30 +0000 (17:20 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 12 Sep 2016 10:53:48 +0000 (06:53 -0400)
commitc8b8bbc3663dacab1bda4c1fa821180674fdc509
treedb46a5eb99070afd708e7bf8702ff78e395d5a48
parent69f4030aadf0e4f8af07493213026b7226531e7f
util: Quiet the logging if perf file doesn't exist

Commit id 'b00d7f29' shifted the opening of the /sys/devices/intel_cqm/type
file from event enable to perf event initialization. If the file did not
exist, then an error would be written to the domain log:

2016-09-06 20:51:21.677+0000: 7310: error : virFileReadAll:1360 : Failed to open file '/sys/devices/intel_cqm/type': No such file or directory

Since the error is now handled in virPerfEventEnable by checking if the
event_attr->attrType == 0 for CMT, MBML, and MBMT events - we can just
use the Quiet API in order to not log the error we're going to throw away.

Additionally, rather than using virReportSystemError, use virReportError
and VIR_ERR_ARGUMENT_UNSUPPORTED in order to signify that support isn't there
for that type of perf event - adjust the error message as well.
src/util/virperf.c