Change in vdsm[master]: virt: vm: sanitize earlier the 'smp' parameter
Dan Kenigsberg has submitted this change and it was merged. Change subject: virt: vm: sanitize earlier the 'smp' parameter .. virt: vm: sanitize earlier the 'smp' parameter In the VM creation path, in the Vm._run() method, we ensure the presence of the 'smp' parameter, which is used in the creation path to build the VM Domain XML to be fed to libvirt. However, parameter sanitization is better done earlier, so this patch moves the check in the Vm.__init__ method, and also adds a couple of tests to ensure the 'smp' parameter is correct. Change-Id: I1b90a26ff6af560359f3d60a73afc56fb25dc15c Signed-off-by: Francesco Romani from...@redhat.com Reviewed-on: http://gerrit.ovirt.org/32827 Reviewed-by: Dan Kenigsberg dan...@redhat.com --- M tests/vmTests.py M vdsm/virt/vm.py 2 files changed, 14 insertions(+), 1 deletion(-) Approvals: Dan Kenigsberg: Looks good to me, approved Francesco Romani: Verified -- To view, visit http://gerrit.ovirt.org/32827 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1b90a26ff6af560359f3d60a73afc56fb25dc15c Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani from...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Vitor de Lima vdel...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: virt: vm: sanitize earlier the 'smp' parameter
Dan Kenigsberg has posted comments on this change. Change subject: virt: vm: sanitize earlier the 'smp' parameter .. Patch Set 2: Code-Review+2 -- To view, visit http://gerrit.ovirt.org/32827 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1b90a26ff6af560359f3d60a73afc56fb25dc15c Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani from...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Vitor de Lima vdel...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: virt: vm: sanitize earlier the 'smp' parameter
oVirt Jenkins CI Server has posted comments on this change. Change subject: virt: vm: sanitize earlier the 'smp' parameter .. Patch Set 3: Build Failed http://jenkins.ovirt.org/job/vdsm_master_unit-tests_merged/4120/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_create-rpms-fc21-x86_64_merged/110/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_create-rpms-el6-x86_64_merged/135/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_create-rpms_merged_test_debug/328/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_verify-error-codes_merged/5960/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_create-rpms-el7-x86_64_merged/132/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_create-rpms-fc20-x86_64_merged/128/ : FAILURE -- To view, visit http://gerrit.ovirt.org/32827 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1b90a26ff6af560359f3d60a73afc56fb25dc15c Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani from...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Vitor de Lima vdel...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: virt: vm: sanitize earlier the 'smp' parameter
Francesco Romani has posted comments on this change. Change subject: virt: vm: sanitize earlier the 'smp' parameter .. Patch Set 2: Verified+1 verified with the newly added test and by booting a VM. I'm not aware of Engines not sending this parameter at least from early 3.4.x. -- To view, visit http://gerrit.ovirt.org/32827 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1b90a26ff6af560359f3d60a73afc56fb25dc15c Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani from...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: virt: vm: sanitize earlier the 'smp' parameter
oVirt Jenkins CI Server has posted comments on this change. Change subject: virt: vm: sanitize earlier the 'smp' parameter .. Patch Set 2: Build Failed http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11761/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12705/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_virt_functional_tests_gerrit/1708/ : There was an infra issue, please contact in...@ovirt.org http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12550/ : SUCCESS -- To view, visit http://gerrit.ovirt.org/32827 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1b90a26ff6af560359f3d60a73afc56fb25dc15c Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani from...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: virt: vm: sanitize earlier the 'smp' parameter
Francesco Romani has uploaded a new change for review. Change subject: virt: vm: sanitize earlier the 'smp' parameter .. virt: vm: sanitize earlier the 'smp' parameter In the VM creation path, in the Vm._run() method, we ensure the presence of the 'smp' parameter, which is used in the creation path to build the VM Domain XML to be fed to libvirt. However, parameter sanitization is better done earlier, so this patch moves the check in the Vm.__init__ method, and also adds a couple of tests to ensure the 'smp' parameter is correct. Change-Id: I1b90a26ff6af560359f3d60a73afc56fb25dc15c Signed-off-by: Francesco Romani from...@redhat.com --- M tests/vmTests.py M vdsm/virt/vm.py 2 files changed, 14 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/27/32827/1 diff --git a/tests/vmTests.py b/tests/vmTests.py index a5f3446..4af07c3 100644 --- a/tests/vmTests.py +++ b/tests/vmTests.py @@ -1795,3 +1795,15 @@ self.assertEqual(vm.status()['status'], vmstatus.SAVING_STATE) # state must not change even after we are sure the event was # handled + + +class TestVmSanity(TestCaseBase): +def testSmpPresentIfNotSpecified(self): +with FakeVM() as testvm: +print testvm.conf +self.assertEqual(int(testvm.conf['smp']), 1) + +def testSmpByParameters(self): +smp = 4 +with FakeVM({'smp': smp}) as testvm: +self.assertEqual(int(testvm.conf['smp']), smp) diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py index a7dc916..c77ba6c 100644 --- a/vdsm/virt/vm.py +++ b/vdsm/virt/vm.py @@ -1451,6 +1451,8 @@ self.conf = {'pid': '0'} self.conf['_blockJobs'] = {} self.conf.update(params) +if 'smp' not in self .conf: +self.conf['smp'] = '1' self._initLegacyConf() # restore placeholders for BC sake self.cif = cif self.log = SimpleLogAdapter(self.log, {vmId: self.conf['vmId']}) @@ -2855,7 +2857,6 @@ def _run(self): self.log.info(VM wrapper has started) -self.conf['smp'] = self.conf.get('smp', '1') devices = self.buildConfDevices() if not self.recovering: -- To view, visit http://gerrit.ovirt.org/32827 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1b90a26ff6af560359f3d60a73afc56fb25dc15c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani from...@redhat.com ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: virt: vm: sanitize earlier the 'smp' parameter
oVirt Jenkins CI Server has posted comments on this change. Change subject: virt: vm: sanitize earlier the 'smp' parameter .. Patch Set 1: Build Failed http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11470/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12414/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_virt_functional_tests_gerrit/1657/ : There was an infra issue, please contact in...@ovirt.org http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12259/ : SUCCESS -- To view, visit http://gerrit.ovirt.org/32827 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1b90a26ff6af560359f3d60a73afc56fb25dc15c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani from...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: virt: vm: sanitize earlier the 'smp' parameter
Francesco Romani has posted comments on this change. Change subject: virt: vm: sanitize earlier the 'smp' parameter .. Patch Set 1: Code-Review-1 (1 comment) a spurious 'print' sneaked in. http://gerrit.ovirt.org/#/c/32827/1/tests/vmTests.py File tests/vmTests.py: Line 1799: Line 1800: class TestVmSanity(TestCaseBase): Line 1801: def testSmpPresentIfNotSpecified(self): Line 1802: with FakeVM() as testvm: Line 1803: print testvm.conf oops. Will remove. Line 1804: self.assertEqual(int(testvm.conf['smp']), 1) Line 1805: Line 1806: def testSmpByParameters(self): Line 1807: smp = 4 -- To view, visit http://gerrit.ovirt.org/32827 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1b90a26ff6af560359f3d60a73afc56fb25dc15c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani from...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches