def mkdir (self,dirname):
return self.test_ssh.mkdir(dirname)
- def kill_all_qemus(self):
- self.run_in_buildname("template-qemu/qemu-kill-node")
+ # we need at least one nodename, as template-qemu is not synced on remote testboxes
+ def kill_all_qemus(self,nodename):
+ self.run_in_buildname("qemu-%s/qemu-kill-node"%nodename)
return True
def list_all_qemus(self):
test_node = TestNode (self, test_site, node_spec)
if not test_node.is_real():
tuples.append( (test_node.host_box(),test_node) )
- # transform into a dict { 'host_box' -> [ hostnames .. ] }
+ # transform into a dict { 'host_box' -> [ test_node .. ] }
result = {}
for (box,node) in tuples:
if not result.has_key(box):
# make this a valid step
def kill_all_qemus(self):
+ # this is the brute force version, kill all qemus on that host box
for (box,nodes) in self.gather_hostBoxes().iteritems():
- # this is the brute force version, kill all qemus on that host box
- TestBox(box,self.options.buildname).kill_all_qemus()
+ # pass the first nodename, as we don't push template-qemu on testboxes
+ nodename=nodes[0].name()
+ TestBox(box,self.options.buildname).kill_all_qemus(nodename)
return True
# make this a valid step
cd $(dirname $0)
cd ..
+# somehow qemu-system-x86_64 show up in pgrep as qemu-system-x86
+COMMANDS_TO_KILL="qemu qemu-system-x86_64 qemu-system-x86"
+
function usage () {
echo "Usage: $COMMAND -l"
echo " lists current qemu processes"
echo "usage: $COMMAND hostname"
echo " kill qemu instance for that node"
+ echo "usage: $COMMAND"
+ echo " kill all instances of [$COMMANDS_TO_KILL]"
exit 1
}
cat $nodedir/qemu.pid 2> /dev/null
done
else
- pgrep qemu
+ for command in $COMMANDS_TO_KILL; do
+ pgrep -x $command
+ done
fi
}
kill_from_file $nodedir/qemu.pid
done
else
- echo Killing all processes mathing qemu
- pkill qemu
+ echo "Killing all processes mathing $COMMANDS_TO_KILL"
+ for command in $COMMANDS_TO_KILL ; do
+ pkill -x $command
+ done
fi
}
. $CONFIG
# the launcher, depending on local/target archs
+# make sure to check qemu-kill-node for consistency
archs="$(uname -i)+$TARGET_ARCH"
case $archs in
i386+i386) QEMU=qemu;;