Skip to content

Instantly share code, notes, and snippets.

@coldfire-x
Created November 23, 2012 07:20
Show Gist options
  • Save coldfire-x/4134354 to your computer and use it in GitHub Desktop.
Save coldfire-x/4134354 to your computer and use it in GitHub Desktop.
get currently cpu affinity from localhost
#!/bin/bash
vmlist=$(virsh list | awk 'NR>2 {print $2}')
for vm in $vmlist
do
#echo "$vm"
virsh vcpuinfo $vm | grep 'CPU A' | awk '{print $3}'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment