Re: [openstack-dev] [nova] libvirt driver: who should create the libvirt.xml file?

2016-06-23 Thread Markus Zoeller
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 [1] 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.
> 
> Regards,
> Daniel
> 

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)


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [nova] libvirt driver: who should create the libvirt.xml file?

2016-06-23 Thread Daniel P. Berrange
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 [1] 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.

Regards,
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 :|

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [nova] libvirt driver: who should create the libvirt.xml file?

2016-06-22 Thread Matthew Booth
On Mon, Jun 20, 2016 at 4:47 PM, Markus Zoeller  wrote:

> White working on the change series to implement the virtlogd feature I
> got feedback [1] 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?
>

I'm also not a huge fan of the division of code for generating libvirt info
different backends in imagebackend. I'm not familiar enough with the xml
generation code to have a firm opinion on how it should be.

My concern looking at [1] is that to the greatest possible extent libvirt
should be a data sink, not a data source. That is: Nova is the canonical
source of truth. In terms of configuration, there should be nothing that
libvirt knows that Nova didn't tell it first, so it should never be
necessary to ask for it. The only reason this might not be true would be
legacy instances, and we should be fixing them up.

So, eg, guest.get_path() shouldn't exist.

Matt


>
> References:
> [1]
> https://review.openstack.org/#/c/323761/2/nova/virt/libvirt/driver.py@4190
>
> --
> Regards, Markus Zoeller (markus_z)
>
>
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>



-- 
Matthew Booth
Red Hat Engineering, Virtualisation Team

Phone: +442070094448 (UK)
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [nova] libvirt driver: who should create the libvirt.xml file?

2016-06-20 Thread Markus Zoeller
White working on the change series to implement the virtlogd feature I
got feedback [1] 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?


References:
[1]
https://review.openstack.org/#/c/323761/2/nova/virt/libvirt/driver.py@4190

-- 
Regards, Markus Zoeller (markus_z)


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev