On Thu, Dec 01, 2011 at 05:02:17PM +0100, Christophe Fergeau wrote:
The code by itself is fine, but I'm not sure about the design
If we go this way, we'll have GVirConfigDomainConsolePty,
GVirConfigDomainConsoleStdio, GVirConfigDomainConsoleFile,
and then GVirConfigDomainSerialPty, GVirConfigDomainSerialStdio,
GVirConfigDomainSerialFile, and the same for channels and parallel ports.
Something that might work is having GVirConfigDomainChardev as a base class
for GVirConfigDomainConsole, GVirConfigDomainSerial, ...
Then we'd also have a GVirConfigDomainChardevSource from which
GVirConfigDomainChardevSourcePty, GVirConfigDomainChardevSourceStdio,
GVirConfigDomainChardevSourceFile, ... would derive.
And finally we'd have some kind of gvir_config_domain_chardev_add_source
API to combine the 2 (GVirConfigDomainConsole +
GVirConfigDomainChardevSourcePty).
There's the added complication that sometimes you have multiple source XML
nodes, sometimes you have a protocol node, so maybe
GVirConfigDomainChardevSourcePty would not even derive from
GVirConfigObject to allow handling that, or it would have a fake <chardev>
toplevel node.
Yes, all good points. I didn't think this through properly. I think
we should have a GVirConfigDomainChardev and {Console,Serial,Parallel}
subclasses. Then have a GVirConfigDomainChardevSource and {Pty,
File, Tcp, etc} subclasses.
I'll withdraw this patch from the series until one of us can do a
proper job.
Daniel
--
|:
http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|:
http://entangle-photo.org -o-
http://live.gnome.org/gtk-vnc :|