diff options
| author | Daniel P. Berrange <berrange@redhat.com> | 2012-03-07 08:39:07 -0500 |
|---|---|---|
| committer | Daniel P. Berrange <berrange@redhat.com> | 2012-03-23 19:23:12 +0000 |
| commit | f6bddbe4161bfb6ff02a807d5455c018c98d607d (patch) | |
| tree | 32725e51fff7c195877032153a376222e2a0ec34 /nova/openstack | |
| parent | 1c6fff4906eb7fd7af9cd507014bea20fb39b7d6 (diff) | |
Introduce a set of classes for storing libvirt guest configuration
With the current Cheetah template based approach to XML
generation, there is never any canonical representation
of the guest configuration. When generating XML, a hash
is filled in with parameters to be used to generate XML,
an even some pre-built XML snippets. When reading XML,
typically XPath is used, but sometimes manual DOM traversal
is used.
This change introduces a set of classes for explicitly
representing the guest configuration. They are intended
to allow the guest config to be read/written using normal
programatic APIs, avoiding the need for any code to know
about XML.
This first impl though, only supports writing of XML.
The code to parse an existing XML doc is not yet written.
The class hierarchy is as follows
LibvirtConfigObject
|
+ LibvirtConfigGuest
+ LibvirtConfigGuestDevice
|
+- LibvirtConfigGuestDisk
+- LibvirtConfigGuestFilesys
+- LibvirtConfigGuestInterface
+- LibvirtConfigGuestInput
+- LibvirtConfigGuestGraphics
+- LibvirtConfigGuestChar
|
+- LibvirtConfigGuestSerial
+- LibvirtConfigGuestConsole
The base LibvirtConfigObject class provides some generic
boilerplate code. Subclasses need to override the "format_dom"
method for generating XML DOMS, and "parse_dom" for reading XML
DOMs. The conversion from DOM <-> XML String is handled by
the base class. The DOMs are based on the lxml.etree.Element
class.
* nova/tests/test_libvirt_config.py: Test cases for XML formatting
of all config object classes
* nova/virt/libvirt/config.py: Config object classes for libvirt
guest XML schema
blueprint libvirt-xml-config-apis
Change-Id: I0474b6640b47ad0e5bb74503a5ff99a8a41bcdc4
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'nova/openstack')
0 files changed, 0 insertions, 0 deletions
