This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


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

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.



Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>