On Fri, Apr 05, 2013 at 01:23:15AM +0200, Marek Marczykowski wrote: > Hi all, > > Xen have (AFAIK unique) feature of having backend device in other domU > (sometimes called driver domain) instead of dom0. Currently libxl support it > for disk and network devices, but in general it is valid for any device > (perhaps excluding PCI). Current implementation requires ID of backend domain > to be specified during device attach/domain startup. There are some upcoming > patches to allow also use domain name. > > I'd like to add support for it into libvirt. The question is how specify > domain reference. The simplest approach is to use direct domain ID, logically > it fits in <source/> tag, so something like: > <disk type='file'> > <source file='/path/to/file/inside/domain/7' domid='7'/> > <target dev='xvdb'/> > </disk> > <interface type='bridge'> > <source bridge='name-of-bridge-in-domiain-7' domid='7'/> > </interface> > > This have obvious limitation that domain ID changes with each domain restart. > But perhaps more correct approach is to use name or UUID? Yeah, I think you're going to want to use the name/uuid here as they are long term stable. > Extending <source/> tag is right thing to do? Or should I add a new tag > (<backenddomain uuid='...'/> ? )? I think perhaps the new tag like <backenddomain> is a good idea. Perhaps just shorten that name to <domain> > Regarding implementation I need some hints how to do the value verification > (check if domain exists at least). If it has to be done in domain_conf.c > (during XML parsing) it will require predetermined domain load order, which > IMHO isn't acceptable. So perhaps the check should be done at domain > startup/device attach (by driver)? > In any case: is it possible at all to check if domain with given name/UUID > exists in scope of domain_conf.c? It looks like it requires connection > reference, which isn't passed to virDomain*DefParseXML. The code in domain_conf.c should only concern itself with syntactic validation. Any kind of semantic validation should live in the driver code, for example in src/xen/*.c (or src/.libxl/*.c if you're planning to use the new xen driver). 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 :| -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list