3 ##############################################################################
4 ## Copyright (c) 2015 Intel Corp.
6 ## All rights reserved. This program and the accompanying materials
7 ## are made available under the terms of the Apache License, Version 2.0
8 ## which accompanies this distribution, and is available at
9 ## http://www.apache.org/licenses/LICENSE-2.0
10 ###############################################################################
15 HOST_IP=$( getHostIP )
22 qmp_sock="/tmp/qmp-sock"
24 #${qemu} -smp ${guest_cpus} -monitor unix:${qmp_sock},server,nowait -daemonize \
25 # -cpu host,migratable=off,+invtsc,+tsc-deadline,pmu=off \
26 # -realtime mlock=on -mem-prealloc -enable-kvm -m 1G \
27 # -mem-path /mnt/hugetlbfs-1g \
28 # -drive file=/root/minimal-centos1.qcow2,cache=none,aio=threads \
29 # -netdev user,id=guest0,hostfwd=tcp:10.2.117.23:5555-:22 \
30 # -device virtio-net-pci,netdev=guest0 \
31 # -nographic -serial /dev/null -parallel /dev/null
33 ${qemu} -smp ${guest_cpus} -monitor unix:${qmp_sock},server,nowait \
34 -cpu host,migratable=off,+invtsc,+tsc-deadline,pmu=off \
35 -drive file=/root/guest1.qcow2 -daemonize \
36 -netdev user,id=net0,hostfwd=tcp:$HOST_IP:5555-:22 \
37 -realtime mlock=on -mem-prealloc -enable-kvm -m 1G \
38 -mem-path /mnt/hugetlbfs-1g \
39 -device virtio-net-pci,netdev=net0 \
42 threads=`echo "info cpus" | nc -U ${qmp_sock} | grep thread_id | cut -d= -f3`
44 # Bind QEMU processor threads to RT CPUs
46 for tid in ${threads} ; do
47 new_tid=`echo $tid | sed -e 's/[\r\n]//g'` # this is required to get rid of cr at end
48 mask=`cpumask ${qemu_cpu[$i]}`
49 taskset -p ${mask} ${new_tid}