From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kt1uu-0004NR-3k for qemu-devel@nongnu.org; Thu, 23 Oct 2008 11:16:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kt1us-0004Lp-Ob for qemu-devel@nongnu.org; Thu, 23 Oct 2008 11:16:03 -0400 Received: from [199.232.76.173] (port=48808 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kt1us-0004Lg-BO for qemu-devel@nongnu.org; Thu, 23 Oct 2008 11:16:02 -0400 Received: from an-out-0708.google.com ([209.85.132.248]:28419) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kt1us-0004A4-CN for qemu-devel@nongnu.org; Thu, 23 Oct 2008 11:16:02 -0400 Received: by an-out-0708.google.com with SMTP id d18so29708and.130 for ; Thu, 23 Oct 2008 08:15:55 -0700 (PDT) Message-ID: <49009517.2040100@codemonkey.ws> Date: Thu, 23 Oct 2008 10:15:35 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: VNC Password References: <87skqn7gnt.fsf@alamut.mobiliz.com.tr> <20081023104755.GI30571@redhat.com> <87hc737dmk.fsf_-_@alamut.mobiliz.com.tr> <49006513.5030000@redhat.com> <873ain7bwm.fsf_-_@alamut.mobiliz.com.tr> In-Reply-To: <873ain7bwm.fsf_-_@alamut.mobiliz.com.tr> Content-Type: multipart/mixed; boundary="------------060006000306020603050409" 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 This is a multi-part message in MIME format. --------------060006000306020603050409 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Volkan YAZICI wrote: > On Thu, 23 Oct 2008, Gerd Hoffmann writes: > >> Volkan YAZICI wrote: >> >>> On Thu, 23 Oct 2008, "Daniel P. Berrange" writes: >>> >>>> If you want daemonized instances, and wish to use the monitor, then >>>> rather than using '-monitor stdio', it'd be better to have it connect >>>> to something like a UNIX socket, eg >>>> >>>> -monitor unix:/var/run/qemu/mysock,server >>>> >>> Excuse my ignorance, but when I use above command, qemu types "QEMU >>> waiting for connection on: /var/run/qemu/monitor.preprod" on the command >>> line and hangs at that state. Is this something expected? >>> >> Yes. If you don't want that, add ",nowait". >> > > This time it complains with an interesting error message: > > # rlwrap /usr/local/sbin/qemu-preprod > qemu: could not open monitor device 'unix:/var/run/qemu/preprod.monitor,nowait' > You need unix:/var/run/qemu/preprod.monitor,server,nowait I use the following program to send commands to the monitor. You would use it like: $ qemu-remote /var/run/qemu/preprod.monitor help Regards, Anthony Liguori > # ls -l /var/run/qemu/preprod.monitor > -rw-r--r-- 1 root root 0 2008-10-23 14:56 /var/run/qemu/preprod.monitor > > BTW, how can I connect to the monitor session -- if I can get it right > at last -- that will be pointed by /var/run/qemu/preprod.monitor? > > >> Try "nc localhost:5001" instead. Qemu listens on the loopback interface >> only if you specify display "localhost:1". netstat should show that. >> > > Umm... Actually, no. I can see it listens on 5901. > > > Regards. > > > --------------060006000306020603050409 Content-Type: text/plain; name="qemu-remote" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-remote" #!/usr/bin/env python import socket, sys if len(sys.argv) < 2: print 'Usage: %s SOCKET' % sys.argv[1] sys.exit(1) s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) s.connect(sys.argv[1]) s.sendall('%s\n' % ' '.join(sys.argv[2:])) buf = '' while not buf.endswith('\n(qemu) '): buf += s.recv(1) noend = False buf = '' while not buf.endswith('\n(qemu) '): t = s.recv(1) if len(t) == 0: noend = True break buf += t if not noend: buf = buf[:-7] _, buf = buf.split('\n', 1) sys.stdout.write(buf) sys.stdout.flush() s.close() --------------060006000306020603050409--