From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Pedaletti Subject: Re: howto control VM from outside (shutdown...) Date: Tue, 20 Jan 2009 23:16:43 +0100 Message-ID: <49764D4B.4060505@gmail.com> References: <4974E154.5020404@gmail.com> <4974F334.7010200@mair-family.org> <200901200855.28307.alberto@byu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: KVM List To: =?UTF-8?B?QWxiZXJ0byBUcmV2acOxbw==?= Return-path: Received: from mail-ew0-f20.google.com ([209.85.219.20]:45505 "EHLO mail-ew0-f20.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753814AbZATWQs convert rfc822-to-8bit (ORCPT ); Tue, 20 Jan 2009 17:16:48 -0500 Received: by ewy13 with SMTP id 13so1195939ewy.13 for ; Tue, 20 Jan 2009 14:16:45 -0800 (PST) In-Reply-To: <200901200855.28307.alberto@byu.edu> Sender: kvm-owner@vger.kernel.org List-ID: ciao Alberto, > -monitor telnet::[port],server,nowait ok > For interactive control I use telnet: > $ telnet localhost [port] ok, it works, thank you > To send commands through a script, I use netcat: > echo "system_powerdown" | netcat -T -c localhost [port] no, it doesn't work :-( $ while : ; do echo "info name" | netcat -T lowdelay -C \ 127.0.0.1 10101 ; sleep 1 ; done =EF=BF=BD=EF=BF=BD=01=EF=BF=BD=EF=BF=BD=03=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF= =BF=BDQEMU 0.9.1 monitor - type 'help' for more information (qemu) info name=EF=BF=BD=EF=BF=BD=01=EF=BF=BD=EF=BF=BD=03=EF=BF=BD=EF=BF= =BD=EF=BF=BD=EF=BF=BDQEMU 0.9.1 monitor - type 'help' for more information (qemu) info name=EF=BF=BD=EF=BF=BD=01=EF=BF=BD=EF=BF=BD=03=EF=BF=BD=EF=BF= =BD=EF=BF=BD=EF=BF=BDQEMU 0.9.1 monitor - type 'help' for more information (qemu) info name=EF=BF=BD=EF=BF=BD=01=EF=BF=BD=EF=BF=BD=03=EF=BF=BD=EF=BF= =BD=EF=BF=BD=EF=BF=BDQEMU 0.9.1 monitor - type 'help' for more information (qemu) info name=EF=BF=BD=EF=BF=BD=01=EF=BF=BD=EF=BF=BD=03=EF=BF=BD=EF=BF= =BD=EF=BF=BD=EF=BF=BDQEMU 0.9.1 monitor - type 'help' for more information (qemu) info name=EF=BF=BD=EF=BF=BD=01=EF=BF=BD=EF=BF=BD=03=EF=BF=BD=EF=BF= =BD=EF=BF=BD=EF=BF=BDQEMU 0.9.1 monitor - type 'help' for more information (qemu) info name=EF=BF=BD=EF=BF=BD=01=EF=BF=BD=EF=BF=BD=03=EF=BF=BD=EF=BF= =BD=EF=BF=BD=EF=BF=BDQEMU 0.9.1 monitor - type 'help' for more information (qemu) info name=EF=BF=BD=EF=BF=BD=01=EF=BF=BD=EF=BF=BD=03=EF=BF=BD=EF=BF= =BD=EF=BF=BD=EF=BF=BDQEMU 0.9.1 monitor - type 'help' for more information command line: (kvm-82, ubuntu 8.10 2.6.27-9-server x86_64) /usr/local/bin/qemu-system-x86_64 -name marco \ -vnc :10 -monitor telnet:127.0.0.1:10101,server,nowait \ -cpu qemu64 -m 512 -smp 1 -vga std \ -drive file=3D/dev/mapper/vm-vm_marco,if=3Dvirtio,cache=3Doff,boot=3Do= n\ -k it -usb -usbdevice tablet -localtime -daemonize \ -net nic,vlan=3D1,model=3De1000,macaddr=3D52:10:11:01:01:01 \ -net vde,vlan=3D1,sock=3D/var/run/vde2/kvm1_vde.ctl \ -net nic,vlan=3D2,model=3Dvirtio,macaddr=3D52:10:11:02:01:01 \ -net vde,vlan=3D2,sock=3D/var/run/vde2/kvm2_vde.ctl \ -pidfile /home/vm/marco/marco.pid do you know/understand why it doesn't works for me? > I also have a PHP script that opens a socket connection to the telnet= port,=20 > sends the command, and parses the output for errors. I'll be happy t= o share=20 > it. Let me know if you want it. yes, thank you. --=20 /* Paolo Pedaletti, * paolo@pedaletti.it www.pedaletti.it */