The connect_volume method in libvirt/volume.py does a couple of
things. It does the host OS integration/setup tasks, and it returns
the libvirt xml. In some cases, only the libvirt xml is required,
and the setup tasks are not necessary.
The following patch separates the setup tasks and libvirt xml return
in connect_volume. A new method, called get_config, is added to just
return the xml config, separate from the connect_volume method.
The connect_volume method will continue to return the libvirt xml,
so that existing functionality is not broken. This way, get_config
can be used to get the libvirt xml without any side-effects, e.g.
re-running shell commands to setup the volume.
There will be a follow up patch, where libvirt's driver.py will
switch over to use get_config and connect_volume will no longer
need to return the libvirt xml.
Reviewed: https:/ /review. openstack. org/116998 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=1b45f4574c8 5288a6fd67a83ff d8c798d436875b
Committed: https:/
Submitter: Jenkins
Branch: master
commit 1b45f4574c85288 a6fd67a83ffd8c7 98d436875b
Author: Thang Pham <email address hidden>
Date: Fri Aug 29 14:45:20 2014 -0400
Split up libvirt volume's connect_volume method
The connect_volume method in libvirt/volume.py does a couple of
things. It does the host OS integration/setup tasks, and it returns
the libvirt xml. In some cases, only the libvirt xml is required,
and the setup tasks are not necessary.
The following patch separates the setup tasks and libvirt xml return
in connect_volume. A new method, called get_config, is added to just
return the xml config, separate from the connect_volume method.
The connect_volume method will continue to return the libvirt xml,
so that existing functionality is not broken. This way, get_config
can be used to get the libvirt xml without any side-effects, e.g.
re-running shell commands to setup the volume.
There will be a follow up patch, where libvirt's driver.py will
switch over to use get_config and connect_volume will no longer
need to return the libvirt xml.
Change-Id: I5d300f8fe99f71 4d63d51197dc89f 556c3a5d43b
Related-Bug: #1359617