qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] read monitor commands from a file


From: Shijesta Victor
Subject: Re: [Qemu-discuss] read monitor commands from a file
Date: Sun, 16 Dec 2012 14:19:37 -0800 (PST)

Thanks for your reply. I will try them out.

regards,
shijesta

--- On Sat, 15/12/12, Mike Lovell <address@hidden> wrote:

From: Mike Lovell <address@hidden>
Subject: Re: [Qemu-discuss] read monitor commands from a file
To: "Shijesta Victor" <address@hidden>
Cc: address@hidden
Date: Saturday, 15 December, 2012, 6:46

On 12/13/2012 08:47 PM, Shijesta Victor wrote:
> Is it possible to read monitor commands off a file? I couldn't get this working.
>
> What I need is this:
> I would have a list of commands in a file, and I want it as if these commands were typed at the monitor prompt one after another.
>

it might be possible to hack something together when running the monitor on a socket. then you can just connect to the socket, write the commands you want, and read the responses. i believe this is how libvirt originally controlled a qemu process.

to get the monitor to use a local unix socket, add '-monitor unix:/path/to/sock,server,nowait' to the command line. then you can use something like `nc -U /path/to/sock < /path/to/command.txt` to connect to the socket and give the commands to the monitor. you could also use tcp or udp sockets but you'll probably want to limit it to listening on localhost.

if you are going to do very many things with the monitor, you might want to look at the qmp interfaces. qmp (qemu management protocol) is a way to talk to the monitor that is a bit nicer for programmatic interaction. it uses json and is documented in the QMP/ directory of the qemu source. there is also some example python in that directory for talking to the monitor.

mike

reply via email to

[Prev in Thread] Current Thread [Next in Thread]