virsh -c qemu:///system qemu-monitor-command --hmp <domain> '<command> [...]'
v qemu-monitor-command --hmp red 'system_powerdown'
port scan
for TCP `nmap -sT -p5900-5960 virtlab1009.lab.eng.rdu2.redhat.com`
SR-IOV configuration
echo 2 > /sys/class/net/enp1s0f0/device/sriov_numvfs
ip link set enp1s0f0 vf 0 mac 52:54:00:ac:39:e2
Mount QCOW2 image
#!/bin/bash
echo mounting $1 on $2
if [ -e $2/. ]; then
echo directory $2 exists
else
echo creating $2
mkdir $2
fi
modprobe nbd max_part=8
qemu-nbd --connect=/dev/nbd0 $1
fdisk /dev/nbd0 -l
mount /dev/nbd0p3 $2
echo running nested shell, type 'exit' to unmount
bash
umount $2
qemu-nbd --disconnect /dev/nbd0
rmmod nbd
enter ruby namespace
#!/bin/bash
if [ x$1 == x ]; then
echo $0 program args ...
echo this command will run inside autohck namespace
echo RUN as admin!
exit
fi
pid=`ps ax | grep 'ruby bin/auto_hck' | grep -v grep | head -n1 | awk '{print $1;}'`
if [ x$pid == x ]; then
echo Ruby instance is not found
else
echo Found ruby process $pid
echo command to run: $*
sudo nsenter -m -n -t $pid $*
fi