[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 27/35] kvm_stat: Abstract ioctl numbers
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 27/35] kvm_stat: Abstract ioctl numbers |
Date: |
Fri, 31 Oct 2014 18:26:05 +0100 |
From: Michael Ellerman <address@hidden>
Unfortunately ioctl numbers are platform specific, so abstract them out
of the code so they can be overridden. As it happens x86 and s390 share
the same values, so nothing needs to change yet.
Signed-off-by: Michael Ellerman <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
scripts/kvm/kvm_stat | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat
index 00d4c5d..a65d0a3 100755
--- a/scripts/kvm/kvm_stat
+++ b/scripts/kvm/kvm_stat
@@ -177,6 +177,12 @@ x86_exit_reasons = {
sc_perf_evt_open = None
exit_reasons = None
+ioctl_numbers = {
+ 'SET_FILTER' : 0x40082406,
+ 'ENABLE' : 0x00002400,
+ 'DISABLE' : 0x00002401,
+}
+
def x86_init(flag):
globals().update({
'sc_perf_evt_open' : 298,
@@ -301,14 +307,14 @@ class Event(object):
raise Exception('perf_event_open failed')
if filter:
import fcntl
- fcntl.ioctl(fd, 0x40082406, filter)
+ fcntl.ioctl(fd, ioctl_numbers['SET_FILTER'], filter)
self.fd = fd
def enable(self):
import fcntl
- fcntl.ioctl(self.fd, 0x00002400, 0)
+ fcntl.ioctl(self.fd, ioctl_numbers['ENABLE'], 0)
def disable(self):
import fcntl
- fcntl.ioctl(self.fd, 0x00002401, 0)
+ fcntl.ioctl(self.fd, ioctl_numbers['DISABLE'], 0)
class TracepointProvider(object):
def __init__(self):
--
1.8.3.1
- [Qemu-devel] [PULL 17/35] Add skip_dump flag to ignore memory region during dump, (continued)
- [Qemu-devel] [PULL 17/35] Add skip_dump flag to ignore memory region during dump, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 18/35] vl.c: Fix Coverity complaining for vmstate_dump_file, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 19/35] kvmvapic: patch_instruction fix, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 20/35] iscsi: Refuse to open as writable if the LUN is write protected, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 21/35] virtio-scsi: Fix memory leak when realize failed, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 22/35] scsi: devirtualize unrealize of SCSI devices, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 23/35] virtio-scsi: Fix num_queue input validation, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 24/35] kvm_stat: Only consider online cpus, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 25/35] kvm_stat: Fix the non-x86 exit reasons, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 26/35] kvm_stat: Rework platform detection, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 27/35] kvm_stat: Abstract ioctl numbers,
Paolo Bonzini <=
- [Qemu-devel] [PULL 28/35] kvm_stat: Add powerpc support, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 29/35] i386: fix breakpoints handling in icount mode, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 32/35] ivshmem: Fix potential OOB r/w access, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 33/35] ivshmem: Fix fd leak on error, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 30/35] ivshmem: Check ivshmem_read() size argument, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 34/35] ivshmem: use error_report, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 35/35] virtio-scsi: fix dataplane, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 31/35] ivshmem: validate incoming_posn value from server, Paolo Bonzini, 2014/10/31