[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 xenstore.



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.

cheers,
  Gerd

-- 
http://kraxel.fedorapeople.org/xenner/

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.