[libvirt] [RFC] API vs XML

Stefan de Konink skinkie at xs4all.nl
Thu May 15 23:26:07 UTC 2008


Hi,


In my previous email Daniel made clear that for many functions it is
preferable to have access to the XML output. I would like to know what the
general opinion is about defining a domain.

I can understand that people don't mind to define a domain manually or
with tools and pump it inside libvirt with the virDomainDefineXML call.


But why are the XML tree manipulating features not incorporated into the
API? Slightly more 'semantics based' than Attach/Detach Device. Allowing
to specify the information that is going into the XML.

So for example:
domainptr = virDomainDefine(name)
virDomainSetName(domainptr, name)
virDomainSetBootloader(domainptr, path)
virDomainSetOS(domainptr, type)
virDomainSetMemory(domainptr, amount, live)
virDomainSetVCPU(domainptr, amount, live)
virDomainAttachDisk(domainptr, type, sourceptr, targetptr, live)
virDomainDetachDevice(domainptr, deviceptr, live)

I know there are people that love XML here, but can someone give a
reasonable statement why not to support the above? (More clean, less
parsing)


Stefan




More information about the libvir-list mailing list