Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions femu-scripts/ftk/qmp-vcpu-pin
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python2
# QEMU vCPU pinning tool
#
# Copyright (C) 2016 Red Hat Inc.
Expand Down Expand Up @@ -29,9 +29,9 @@ devnull = open(os.devnull, 'w')
srv = QEMUMonitorProtocol(args.server)
srv.connect()

for vcpu in srv.command('query-cpus'):
vcpuid = vcpu['CPU']
tid = vcpu['thread_id']
for vcpu in srv.command('query-cpus-fast'):
vcpuid = vcpu['cpu-index']
tid = vcpu['thread-id']
if tid in pinned:
print 'vCPU{}\'s tid {} already pinned, skipping'.format(vcpuid, tid)
continue
Expand All @@ -42,4 +42,4 @@ for vcpu in srv.command('query-cpus'):
call(['taskset', '-pc', str(cpuid), str(tid)], stdout=devnull)
pinned.append(tid)
except OSError:
print 'Failed to pin vCPU{} to CPU{}'.format(vcpuid, cpuid)
print 'Failed to pin vCPU{} to CPU{}'.format(vcpuid, cpuid)
1 change: 1 addition & 0 deletions femu-scripts/ftk/qmp.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/python2
# QEMU Monitor Protocol Python class
#
# Copyright (C) 2009, 2010 Red Hat Inc.
Expand Down