Hide Forgot
Description of problem: libvirt will enable perf event which user want disable it Version-Release number of selected component (if applicable): libvirt-1.3.5-1.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1. prepare a guest # virsh perf rhel7.0-rhel cmt : disabled mbmt : disabled mbml : disabled 2. disable and enable different perf event in one cmdline: # virsh perf rhel7.0-rhel --disable mbml --enable cmt 3. check result: # virsh perf rhel7.0-rhel cmt : enabled mbmt : disabled mbml : enabled Actual results: libvirt will enable a perf event which should be disabled Expected results: 2 options 1. Reject use --disable and --enable at the same time 2. fix this case Additional info:
Fixed upstream: commit da8285c44a1db7b3ee85920a08dc80a133254c49 Author: Peter Krempa <pkrempa@redhat.com> Date: Wed Jun 15 16:07:20 2016 +0200 qemu: perf: Don't set state of first event for every other event A bug in the code used the value of the first perf event as state for all the mentioned one rather than extracting individual ones. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1346730
verified on libvirt-2.0.0-1.el7.x86_64, the result is as expected. 1. guest is shutdown # virsh dumpxml rhel7.2 | grep /perf -B4 <perf> <event name='cmt' enabled='no'/> <event name='mbmt' enabled='no'/> <event name='mbml' enabled='no'/> </perf> # virsh perf rhel7.2 cmt : disabled mbmt : disabled mbml : disabled # virsh perf rhel7.2 --disable cmt --enable mbml # virsh perf rhel7.2 cmt : disabled mbmt : disabled mbml : enabled # virsh perf rhel7.2 --enable cmt,mbmt # virsh perf rhel7.2 cmt : enabled mbmt : enabled mbml : enabled # virsh dumpxml rhel7.2 | grep /perf -B4 <perf> <event name='cmt' enabled='yes'/> <event name='mbmt' enabled='yes'/> <event name='mbml' enabled='yes'/> </perf>
Unexpected error occur when disable some event which is already disabled while the guest is running. Test on libvirt-2.0.0-1.el7.x86_64 1.When disable some event which is already disabled, it will report error. # virsh start rhel7.2 Domain rhel7.2 started # virsh perf rhel7.2 cmt : disabled mbmt : disabled mbml : disabled # virsh perf rhel7.2 --disable cmt error: Unable to enable/disable perf events error: Unable to disable perf event type=0: Bad file descriptor # virsh perf rhel7.2 --disable mbmt error: Unable to enable/disable perf events error: Unable to disable perf event type=1: Bad file descriptor # virsh perf rhel7.2 --disable mbml error: Unable to enable/disable perf events error: Unable to disable perf event type=2: Bad file descriptor 2. When combine enable and disable, the --enable part succeed, but the --disable part report error. # virsh start rhel7.2 Domain rhel7.2 started # virsh perf rhel7.2 cmt : disabled mbmt : disabled mbml : disabled # virsh perf rhel7.2 --enable mbmt --disable cmt error: Unable to enable/disable perf events error: Unable to disable perf event type=0: Bad file descriptor # virsh perf rhel7.2 cmt : disabled mbmt : enabled mbml : disabled # virsh perf rhel7.2 --enable mbml --disable cmt error: Unable to enable/disable perf events error: Unable to disable perf event type=0: Bad file descriptor # virsh perf rhel7.2 cmt : disabled mbmt : enabled mbml : enabled
follow peter's suggestion to move the comment 4 to https://bugzilla.redhat.com/show_bug.cgi?id=1360533#c3
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2016-2577.html