All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: VNC Password
Date: Thu, 23 Oct 2008 10:15:35 -0500	[thread overview]
Message-ID: <49009517.2040100@codemonkey.ws> (raw)
In-Reply-To: <873ain7bwm.fsf_-_@alamut.mobiliz.com.tr>

[-- Attachment #1: Type: text/plain, Size: 1673 bytes --]

Volkan YAZICI wrote:
> On Thu, 23 Oct 2008, Gerd Hoffmann <kraxel@redhat.com> writes:
>   
>> Volkan YAZICI wrote:
>>     
>>> On Thu, 23 Oct 2008, "Daniel P. Berrange" <berrange@redhat.com> 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.
>
>
>   


[-- Attachment #2: qemu-remote --]
[-- Type: text/plain, Size: 576 bytes --]

#!/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()

  parent reply	other threads:[~2008-10-23 15:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-23 10:24 [Qemu-devel] VNC Password Volkan YAZICI
2008-10-23 10:47 ` Daniel P. Berrange
2008-10-23 11:30   ` [Qemu-devel] " Volkan YAZICI
2008-10-23 11:50     ` Gerd Hoffmann
2008-10-23 12:07       ` Volkan YAZICI
2008-10-23 12:52         ` Gerd Hoffmann
2008-10-23 15:15         ` Anthony Liguori [this message]
2008-10-23 11:46 ` [Qemu-devel] " Gerd Hoffmann
2008-10-23 12:08   ` [Qemu-devel] " Volkan YAZICI
2008-10-23 12:57     ` Gerd Hoffmann
2008-10-23 15:10       ` François Revol
2008-10-23 15:45         ` Laurent Vivier
2008-10-24 11:06           ` François Revol
2008-10-24 11:20             ` Jamie Lokier
2008-10-24 11:47               ` François Revol
2008-10-24 12:02                 ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49009517.2040100@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.