[Top][All Lists]

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

Re: [Xen-devel] Re: [Qemu-devel] [PATCH 12/13] set vnc password from xen

From: Gerd Hoffmann
Subject: Re: [Xen-devel] Re: [Qemu-devel] [PATCH 12/13] set vnc password from xenstore.
Date: Fri, 22 Aug 2008 10:27:55 +0200
User-agent: Thunderbird (X11/20080723)

Anthony Liguori wrote:
> Gerd Hoffmann wrote:
>> Multiple monitor instances would be very useful anyway.
> The trick here is to add a MonitorState context to every callback and
> have term_printf() take a MonitorState as the first argument.  It's a
> mostly mechanical change.

The devil is in the details ...

How do we want support multiple monitors?  One way would be using
multiple -monitor switches, so you can have -- say -- one pty for
libvirt and one vc for the user / developer.  Another way would be
allowing multiple connects to unix/tcp sockets, which is probably a bit
more tricky due to qemu not having infrastructure for that (yet).  We
also could do both ...

And when touching all monitor command functions anyway, we could also
cleanup the handler mess a bit ;)

How about this:  We define *two* different callback functions:

    typedef struct term_cmd_t {
        [ ... ]
        void (*handler_one)(MonitorState *s, const char *arg);
        void (*handler_many)(MonitorState *s, int argv, char *argv[])
        [ ... ]

The first one can be used by the monitor functions taking at most one
argument, with minimal source code changes, which is probably more than
90% of them.  The remaining ones can be converted to use the second form.



reply via email to

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