Change in vdsm[master]: XML helper for virt introduced

mzamazal at redhat.com mzamazal at redhat.com
Mon Feb 1 15:46:42 UTC 2016


Milan Zamazal has posted comments on this change.

Change subject: XML helper for virt introduced
......................................................................


Patch Set 1:

(2 comments)

https://gerrit.ovirt.org/#/c/52821/1//COMMIT_MSG
Commit Message:

Line 14: 
Line 15: The rough plan is as follows:
Line 16: 
Line 17: 1. Abstract common XML operations used when handling device XML's into a
Line 18:    separate, DOM implementation independent, XML API.
> this is a good way forward. In the long ran (= after the switch is made) we
> we will not need this abstraction anymore

It can be still useful to use the helpers afterwards, to not force programmers thinking about some DOM handling nuances (I'll post a followup etree patch where that should be visible).

| Maybe we could try to bend our transitional abstract API as much as possible towards etree's API?

Probably a good idea.
Line 19: 2. Move XML processing out of DomainDescriptor and make DomainDescriptor
Line 20:    use the new XML API.
Line 21: 3. Get rid of all XML/DOM processing in VM and closely related places
Line 22:    and make it all to use the new XML API.  This step will consist of


https://gerrit.ovirt.org/#/c/52821/1/vdsm/virt/xmlutil.py
File vdsm/virt/xmlutil.py:

Line 22: 
Line 23: 
Line 24: class XML(object):
Line 25: 
Line 26:     @classmethod
> not sure I understand why we need so many classmethods.
All the methods are going to be used in the followup patches.  As for why they are classmethods: They could be staticmethods or functions as well now, I just wanted them to be put (visibly) in a single place and possibly being inheritable just in case.  No instance on that, we'll see how it evolves.
Line 27:     def parse_string(cls, xml_str):
Line 28:         return xml.dom.minidom.parseString(xml_str)
Line 29: 
Line 30:     @classmethod


-- 
To view, visit https://gerrit.ovirt.org/52821
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic177df4ef193c59b77220a6073cd35d28daa3cf1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Milan Zamazal <mzamazal at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzamazal at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list