[openstack-dev] [nova] libvirt driver: who should create the libvirt.xml file?
mzoeller at linux.vnet.ibm.com
Thu Jun 23 11:48:26 UTC 2016
On 23.06.2016 11:50, Daniel P. Berrange wrote:
> On Mon, Jun 20, 2016 at 05:47:57PM +0200, Markus Zoeller wrote:
>> White working on the change series to implement the virtlogd feature I
>> got feedback  to move code which creates parts of the libvirt.xml
>> file from the "driver" module into the "guest" module. I'm a bit
>> hesitant to do so as the responsibility of creating a valid libvirt.xml
>> file is then spread across 3 modules:
>> * driver.py
>> * guest.py
>> * designer.py
>> I'm only looking for a guideline here (The "driver" module is humongous
>> and I think it would be a good thing to have the "libvirt.xml" creation
>> code outside of it). Thoughts?
> The designer.py file was created as a place which would ultimately hold
> all the XML generator logic.
> Ultimately the "_get_guest_xml" (and everything it calls) from driver.py
> would move into the designer.py class. Before we could do that though, we
> needed to create the host.py + guest.py classes to isolate the libvirt
> API logic.
> Now that the guest.py conversion/move is mostly done, we should be able
> to start moving the XML generation out of driver.py and into designer.py
> I would definitely *not* put XML generation code into guest.py
> In terms of your immediate patch, I'd suggest just following current
> practice and putting your new code in driver.py. We'll move everything
> over to designer.py at the same time, later on.
Cool, thanks! That was the guideline I hoped for. Count me in when the
move to "designer.py" gets tackled.
Regards, Markus Zoeller (markus_z)
More information about the OpenStack-dev