From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JUqTg-0003jE-C6 for qemu-devel@nongnu.org; Thu, 28 Feb 2008 16:39:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JUqTe-0003iv-Ug for qemu-devel@nongnu.org; Thu, 28 Feb 2008 16:39:43 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUqTe-0003ip-HV for qemu-devel@nongnu.org; Thu, 28 Feb 2008 16:39:42 -0500 Received: from quinthar.com ([72.52.120.178]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1JUqTe-0006eF-0X for qemu-devel@nongnu.org; Thu, 28 Feb 2008 16:39:42 -0500 Received: from 70.6.244.90 ([70.6.244.90]) by quinthar.com for ; Thu, 28 Feb 2008 13:39:28 -0800 Message-ID: <47C72A08.5090209@quinthar.com> Date: Thu, 28 Feb 2008 13:39:20 -0800 From: David Barrett MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Tips for adding "sendkeys" Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi there, can you give me any tips for where to get started adding a new function "sendkeys" to the monitor that is essentially like "sendkey" except for multiple keystrokes? I'm using Qemu for some automated testing (in conjunction with AutoIt on the guest XP image) and it's working great. Essentially, I've set up: 1) A stock XP guest image with all windows closed except for a big command prompt that has keyboard focus. 2) A script on the Linux host that launches the guest with "-loadvm" and "-monitor stdio" that uses "sendkey" to start an AutoIt script inside the guest. The AutoIt script does all the heavy lifting of actually running the automated test. However, I need "sendkey" in order to download the latest test script into the guest OS, and then to run it. This works fine today, but I'm finding my Linux host scripts full of long strings of: sendkey ret sendkey a sendkey kp_decimal sendkey a sendkey u sendkey 3 sendkey ret I'd much rather do something like: sendkeys wget http://10.0.2.2/script.au3\ret sendkeys script.au3\ret I'm guessing this is a very straightforward addition to the monitor code. However, the Qemu source is rather imposing and I'm not sure where to start. Can someone give me some file and function names to start looking around? Something along the lines of: "Oh, that should be simple. Open up foo.c and look for function bar(); it lists all the monitor commands. Add "sendkeys" to the list, and implement it in foo_impl.c. I recommend just calling "foo_sendkey()" as you loop across the string. Also, be sure to increment "numcommands" in "foo_func.h" else it'll destroy the universe." Any tips you have would be appreciated. Thanks! -david