Hello Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/26023
to review the following change.
Change subject: vm: consider 'action' when handling I/O errors
......................................................................
vm: consider 'action' when handling I/O errors
When VDSM receives an I/O error event from libvirt,
it does not consider the value of the 'action' callback
field, and thus considers the guest CPU stopped.
This is true in the default configuration, which translates
to the disk write error policy 'stop', but not necessarily
true if the said policy is 'enospace'.
In this case the reported state of the CPU goes out of sync.
Since the error policy may be changed through an hook,
the safest thing to do is actually check the 'action'
value as reported by libvirt in the IOError callback.
This patch adds this check, and additional logging in
the case the guest CPU is reported running after I/O
errors.
Change-Id: I9299399c3e5bef7e6e3111aa35e3483827ad57da
Bug-Url: https://bugzilla.redhat.com/1064630
Signed-off-by: Francesco Romani <[email protected]>
Reviewed-on: http://gerrit.ovirt.org/25157
Reviewed-by: Dan Kenigsberg <[email protected]>
Tested-by: Dan Kenigsberg <[email protected]>
---
M vdsm/clientIF.py
M vdsm/vm.py
2 files changed, 17 insertions(+), 9 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/23/26023/1
diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index c028216..624aee1 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -546,7 +546,7 @@
v._rtcUpdate(utcoffset)
elif eventid == libvirt.VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON:
srcPath, devAlias, action, reason = args[:-1]
- v._onAbnormalStop(devAlias, reason)
+ v._onIOError(devAlias, reason, action)
elif eventid == libvirt.VIR_DOMAIN_EVENT_ID_GRAPHICS:
phase, localAddr, remoteAddr, authScheme, subject = args[:-1]
v.log.debug('graphics event phase '
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 0db8466..7944519 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -4510,20 +4510,28 @@
graphics.setAttribute('connected', 'keep')
self._dom.updateDeviceFlags(graphics.toxml(), 0)
- def _onAbnormalStop(self, blockDevAlias, err):
+ def _onIOError(self, blockDevAlias, err, action):
"""
Called back by IO_ERROR_REASON event
:param err: one of "eperm", "eio", "enospc" or "eother"
Note the different API from that of Vm._onAbnormalStop
"""
- self.log.info('abnormal vm stop device %s error %s',
- blockDevAlias, err)
- self.conf['pauseCode'] = err.upper()
- self._guestCpuRunning = False
- if err.upper() == 'ENOSPC':
- if not self.extendDrivesIfNeeded():
- self.log.info("No VM drives were extended")
+ if action == libvirt.VIR_DOMAIN_EVENT_IO_ERROR_PAUSE:
+ self.log.info('abnormal vm stop device %s error %s',
+ blockDevAlias, err)
+ self.conf['pauseCode'] = err.upper()
+ self._guestCpuRunning = False
+ if err.upper() == 'ENOSPC':
+ if not self.extendDrivesIfNeeded():
+ self.log.info("No VM drives were extended")
+ elif action == libvirt.VIR_DOMAIN_EVENT_IO_ERROR_REPORT:
+ self.log.info('I/O error %s device %s reported to guest OS',
+ err, blockDevAlias)
+ else:
+ # we do not support and do not expect other values
+ self.log.warning('unexpected action %i on device %s error %s',
+ action, blockDevAlias, err)
def _acpiShutdown(self):
self._dom.shutdownFlags(libvirt.VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN)
--
To view, visit http://gerrit.ovirt.org/26023
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9299399c3e5bef7e6e3111aa35e3483827ad57da
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.4
Gerrit-Owner: Francesco Romani <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches