Peter V. Saveliev has uploaded a new change for review.
Change subject: vdsm: cope with I/O errors, getting permissions
......................................................................
vdsm: cope with I/O errors, getting permissions
Treat OSError during floppy image permission check as a
read-only floppy. Later the floppy can be safely "ejected",
if the error persists.
Bug-Url:
https://bugzilla.redhat.com/show_bug.cgi?id=755528
Change-Id: I1f595a7adc05cd2efbfb831c247233ecb01da05a
Signed-off-by: Peter V. Saveliev <peet(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 9 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/71/18371/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 4f80b4c..165670a 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -1531,10 +1531,15 @@
driverAttrs['error_policy'] = 'stop'
diskelem.appendChildWithArgs('driver', **driverAttrs)
elif self.device == 'floppy':
- if (self.path and
- not utils.getUserPermissions(constants.QEMU_PROCESS_USER,
- self.path)['write']):
- diskelem.appendChildWithArgs('readonly')
+ if self.path:
+ try:
+ wp = utils.getUserPermissions(constants.QEMU_PROCESS_USER,
+ self.path)['write'])
+ except OSError:
+ wp = False
+
+ if not wp:
+ diskelem.appendChildWithArgs('readonly')
if hasattr(self, 'specParams') and 'ioTune' in self.specParams:
self._validateIoTuneParams()
--
To view, visit
http://gerrit.ovirt.org/18371
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f595a7adc05cd2efbfb831c247233ecb01da05a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Peter V. Saveliev <peet(a)redhat.com>