Vinzenz Feenstra has uploaded a new change for review.
Change subject: virt: Always execute after_hibernation event ......................................................................
virt: Always execute after_hibernation event
Previously we had no way that the after_hibernation event got executed. The enableGuestEvents value was never set to true and we're now also dropping it on the migration destination. Since there is also no parameter for enabling guest events on the suspend call it, we decided that it is much more beneficial to let the VM always know that it is going to be hibernated and/or has been resumed from hibernation. Since purely from theory this information can be also determined without the notifications there's no security issue that the Virtual Machine would know too much about it's environment. However it's beneficial for a range of applications which need to resynchronize, adjust the time or re-accquire an IP address via DHCP etc.
Change-Id: Ic52b8c22d57028fb6459c7faa2bcfebd8f32d6c4 Bug-Url: https://bugzilla.redhat.com/1349907 Signed-off-by: Vinzenz Feenstra vfeenstr@redhat.com --- M vdsm/virt/vm.py 1 file changed, 12 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/14/59914/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py index c2b1b93..d8e4239 100644 --- a/vdsm/virt/vm.py +++ b/vdsm/virt/vm.py @@ -1866,14 +1866,19 @@ except Exception: self.log.exception("Failed to connect to guest agent channel")
- try: - if self.conf.get('enableGuestEvents', False): - if self.lastStatus == vmstatus.MIGRATION_DESTINATION: + if self.lastStatus == vmstatus.RESTORING_STATE: + try: + self.guestAgent.events.after_hibernation() + except Exception: + self.log.exception("Unexpected error on guest after " + "hibernation notification") + elif self.conf.get('enableGuestEvents', False): + if self.lastStatus == vmstatus.MIGRATION_DESTINATION: + try: self.guestAgent.events.after_migration() - elif self.lastStatus == vmstatus.RESTORING_STATE: - self.guestAgent.events.after_hibernation() - except Exception: - self.log.exception("Unexpected error on guest event notification") + except Exception: + self.log.exception("Unexpected error on guest after " + "migration notification")
# Drop enableGuestEvents from conf - Not required from here anymore self.conf.pop('enableGuestEvents', None)
gerrit-hooks has posted comments on this change.
Change subject: virt: Always execute after_hibernation event ......................................................................
Patch Set 1:
* #1349907::Update tracker: OK * Check Bug-Url::OK * Check Public Bug::#1349907::OK, public bug * Check Product::#1349907::OK, Correct classification oVirt * Check TM::SKIP, not in a monitored branch (ovirt-3.6 ovirt-4.0) * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Milan Zamazal has posted comments on this change.
Change subject: virt: Always execute after_hibernation event ......................................................................
Patch Set 1: Code-Review+1
gerrit-hooks has posted comments on this change.
Change subject: virt: Always execute after_hibernation event ......................................................................
Patch Set 2:
* #1349907::Update tracker: OK * Check Bug-Url::OK * Check Public Bug::#1349907::OK, public bug * Check Product::#1349907::OK, Correct classification oVirt * Check TM::SKIP, not in a monitored branch (ovirt-3.6 ovirt-4.0) * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Francesco Romani has posted comments on this change.
Change subject: virt: Always execute after_hibernation event ......................................................................
Patch Set 2: Code-Review+2
From Dan Kenigsberg danken@redhat.com:
Dan Kenigsberg has submitted this change and it was merged.
Change subject: virt: Always execute after_hibernation event ......................................................................
virt: Always execute after_hibernation event
Previously we had no way that the after_hibernation event got executed. The enableGuestEvents value was never set to true and we're now also dropping it on the migration destination. Since there is also no parameter for enabling guest events on the suspend call it, we decided that it is much more beneficial to let the VM always know that it is going to be hibernated and/or has been resumed from hibernation. Since purely from theory this information can be also determined without the notifications there's no security issue that the Virtual Machine would know too much about it's environment. However it's beneficial for a range of applications which need to resynchronize, adjust the time or re-accquire an IP address via DHCP etc.
Change-Id: Ic52b8c22d57028fb6459c7faa2bcfebd8f32d6c4 Bug-Url: https://bugzilla.redhat.com/1349907 Signed-off-by: Vinzenz Feenstra vfeenstr@redhat.com Reviewed-on: https://gerrit.ovirt.org/59914 Reviewed-by: Milan Zamazal mzamazal@redhat.com Reviewed-by: Francesco Romani fromani@redhat.com Continuous-Integration: Jenkins CI --- M vdsm/virt/vm.py 1 file changed, 12 insertions(+), 7 deletions(-)
Approvals: Jenkins CI: Passed CI tests Vinzenz Feenstra: Verified Francesco Romani: Looks good to me, approved Milan Zamazal: Looks good to me, but someone else must approve
vdsm-patches@lists.fedorahosted.org