Francesco Romani has uploaded a new change for review.
Change subject: vm: run before_vm_create hook only in the VM boot ......................................................................
vm: run before_vm_create hook only in the VM boot
The 'before_vm_create' hook is running in two flows: * as expected, in the VM creation flow. * as may not be expected, in the VM dehybernation flow.
The latter is surprising and, most important, contractdicting because in the dehibernation flow * the domain XML returned by the before_vm_create is never used * just after the before_vm_create hook, we run the before_vm_dehibernate hook with the stored domain XML.
At risk to breaking some probably already incorrect hook, this patch makes the before_vm_create hook run only in the VM creation path.
Change-Id: I2ad05e39029acc7b898c7b2af2141bba1d7d3c8e Signed-off-by: Francesco Romani fromani@redhat.com --- M vdsm/virt/vm.py 1 file changed, 3 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/30/34530/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py index 6e46119..751947e 100644 --- a/vdsm/virt/vm.py +++ b/vdsm/virt/vm.py @@ -2667,10 +2667,6 @@ # we need to complete the initialization, including # domDependentInit, after the migration is completed.
- if not self.recovering and initDomain: - domxml = hooks.before_vm_start(self._buildDomainXML(), self.conf) - self.log.debug(domxml) - if self.recovering: self._dom = NotifyingVirDomain( self._connection.lookupByUUIDString(self.id), @@ -2698,6 +2694,9 @@ self._connection.lookupByUUIDString(self.id), self._timeoutExperienced) else: + domxml = hooks.before_vm_start(self._buildDomainXML(), self.conf) + self.log.debug(domxml) + flags = libvirt.VIR_DOMAIN_NONE if 'launchPaused' in self.conf: flags |= libvirt.VIR_DOMAIN_START_PAUSED
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vm: run before_vm_create hook only in the VM boot ......................................................................
Patch Set 1:
Build Failed
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/13216/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/13057/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/12267/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_virt_functional_tests_gerrit/1853/ : There was an infra issue, please contact infra@ovirt.org
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vm: run before_vm_create hook only in the VM boot ......................................................................
Patch Set 2:
Build Failed
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/12635/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/13587/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_virt_functional_tests_gerrit/1933/ : There was an infra issue, please contact infra@ovirt.org
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created_staging/201/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/13425/ : SUCCESS
automation@ovirt.org has posted comments on this change.
Change subject: vm: run before_vm_create hook only in the VM boot ......................................................................
Patch Set 3:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vm: run before_vm_create hook only in the VM boot ......................................................................
Patch Set 3:
Build Started (1/2) -> http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/16912/
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vm: run before_vm_create hook only in the VM boot ......................................................................
Patch Set 3:
Build Started (2/2) -> http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/17085/
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vm: run before_vm_create hook only in the VM boot ......................................................................
Patch Set 3:
Build Successful
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/16912/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/17085/ : SUCCESS
Francesco Romani has posted comments on this change.
Change subject: vm: run before_vm_create hook only in the VM boot ......................................................................
Patch Set 3: Code-Review-1
(1 comment)
https://gerrit.ovirt.org/#/c/34530/3/vdsm/virt/vm.py File vdsm/virt/vm.py:
Line 2236: self._dom = NotifyingVirDomain( Line 2237: self._connection.lookupByUUIDString(self.id), Line 2238: self._timeoutExperienced) Line 2239: else: Line 2240: domxml = hooks.before_vm_start(self._buildDomainXML(), self.conf) restore the missing comment Line 2241: self.log.debug(domxml) Line 2242: Line 2243: flags = libvirt.VIR_DOMAIN_NONE Line 2244: if 'launchPaused' in self.conf:
automation@ovirt.org has posted comments on this change.
Change subject: vm: run before_vm_create hook only in the VM boot ......................................................................
Patch Set 4:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: vm: run before_vm_create hook only in the VM boot ......................................................................
Patch Set 5:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Francesco Romani has abandoned this change.
Change subject: vm: run before_vm_create hook only in the VM boot ......................................................................
Abandoned
I guess this pet peeve of mine should wait better times.
automation@ovirt.org has posted comments on this change.
Change subject: vm: run before_vm_create hook only in the VM boot ......................................................................
Patch Set 5:
* Update tracker::IGNORE, no Bug-Url found
vdsm-patches@lists.fedorahosted.org