Francesco Romani has uploaded a new change for review.
Change subject: vm: split device init from domDependentInit
......................................................................
vm: split device init from domDependentInit
Move into an helper to modularize Vm._domDependentInit()
with no change of behaviour.
Change-Id: I33b347889c930b4ae2fa183e7202ed0dd7b9da26
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 25 insertions(+), 21 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/14/59814/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 3cd4aba..d3a45ab 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1839,24 +1839,8 @@
raise MissingLibvirtDomainError(vmexitreason.LIBVIRT_START_FAILED)
self._updateDomainDescriptor()
-
- # REQUIRED_FOR migrate from vdsm-4.16
- #
- # We need to clean out unknown devices that are created for
- # RNG devices by VDSM 3.5 and are left in the configuration
- # after upgrade to 3.6.
- self._fixLegacyRngConf()
-
- self._getUnderlyingVmDevicesInfo()
- self._updateAgentChannels()
-
- # Currently there is no protection agains mirroring a network twice,
- if not self.recovering:
- for nic in self._devices[hwclass.NIC]:
- if hasattr(nic, 'portMirroring'):
- for network in nic.portMirroring:
- supervdsm.getProxy().setPortMirroring(network,
- nic.name)
+
+ self._dom_init_devices()
self._guestEventTime = self._startTime
sampling.stats_cache.add(self.id)
@@ -1877,9 +1861,6 @@
# Drop enableGuestEvents from conf - Not required from here anymore
self.conf.pop('enableGuestEvents', None)
- for con in self._devices[hwclass.CONSOLE]:
- con.prepare()
-
self._guestCpuRunning = self._isDomainRunning()
self._logGuestCpuStatus('domain initialization')
if self.lastStatus not in (vmstatus.MIGRATION_DESTINATION,
@@ -1897,6 +1878,29 @@
self._dom_init_sla()
+ def _dom_init_devices(self):
+ # REQUIRED_FOR migrate from vdsm-4.16
+ #
+ # We need to clean out unknown devices that are created for
+ # RNG devices by VDSM 3.5 and are left in the configuration
+ # after upgrade to 3.6.
+ self._fixLegacyRngConf()
+
+ self._getUnderlyingVmDevicesInfo()
+ self._updateAgentChannels()
+
+ # Currently there is no protection agains mirroring a network twice,
+ if not self.recovering:
+ for nic in self._devices[hwclass.NIC]:
+ if hasattr(nic, 'portMirroring'):
+ for network in nic.portMirroring:
+ supervdsm.getProxy().setPortMirroring(network,
+ nic.name)
+
+ # must be done after the setup and once the device is ready
+ for con in self._devices[hwclass.CONSOLE]:
+ con.prepare()
+
def _dom_init_sla(self):
nice = int(self.conf.get('nice', '0'))
nice = max(min(nice, 19), 0)
--
To view, visit
https://gerrit.ovirt.org/59814
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I33b347889c930b4ae2fa183e7202ed0dd7b9da26
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>