Francesco Romani has uploaded a new change for review. Change subject: vm: do not use _dom for powerdown ......................................................................
vm: do not use _dom for powerdown We must avoid the proliferation of trivial helper methods, but using private VM fields across modules is a greater evil, even if modules are part of the same package and affine, like vm.py and vmpowerdown.py To avoid that, a new simple method is added to request clean shutdown of a VM through ACPI events. Change-Id: Ia99a8a557b9bbbaf693eb0e89aa9f39c0ecce400 Signed-off-by: Francesco Romani <[email protected]> --- M vdsm/virt/vm.py M vdsm/virt/vmpowerdown.py 2 files changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/01/31901/1 diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py index 1847680..abc6182 100644 --- a/vdsm/virt/vm.py +++ b/vdsm/virt/vm.py @@ -4872,6 +4872,9 @@ return self.releaseVm() + def acpiShutdown(self): + self._dom.shutdownFlags(libvirt.VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN) + def setBalloonTarget(self, target): if self._dom is None: diff --git a/vdsm/virt/vmpowerdown.py b/vdsm/virt/vmpowerdown.py index 890c8be..3bdb6bf 100644 --- a/vdsm/virt/vmpowerdown.py +++ b/vdsm/virt/vmpowerdown.py @@ -88,7 +88,7 @@ return self.event.wait(self.delay + self.timeout) def acpiCallback(self): - self.vm._dom.shutdownFlags(libvirt.VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN) + self.vm.acpiShutdown() return self.event.wait(self.timeout) def forceCallback(self): -- To view, visit http://gerrit.ovirt.org/31901 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia99a8a557b9bbbaf693eb0e89aa9f39c0ecce400 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.5 Gerrit-Owner: Francesco Romani <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
