Change in vdsm[master]: tests: do not check permissions on dos filesystem
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: tests: do not check permissions on dos filesystem
......................................................................
tests: do not check permissions on dos filesystem
commit 0b147dc2e247e787ad760ba30a8b8815eb65daca
introduced an extra step in unit tests, to check
the permissions of the files in the created filesystem.
This is fine for filesystems which support permissions,
but DOSFS/FAT/VFAT does not, then the tests on this
filesystem started to fail for no good reasons.
This patch fixes this misbehaviour by disabling the
permissions check in filesystem which do not support
them.
Change-Id: I9c14b3cc0538e2f8b09ea99a185ec86e067217f6
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M tests/mkimageTests.py
1 file changed, 15 insertions(+), 14 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/16/22816/1
diff --git a/tests/mkimageTests.py b/tests/mkimageTests.py
index 463e048..606394b 100644
--- a/tests/mkimageTests.py
+++ b/tests/mkimageTests.py
@@ -103,7 +103,7 @@
self.assertEqual(bool(data.st_mode & perm), expected,
'%s: %s' % (filepath, oct(data.st_mode)))
- def _check_content(self):
+ def _check_content(self, checkPerms=True):
"""
Ensure that the workdir contains what we want
"""
@@ -117,18 +117,19 @@
else:
self.assertTrue(os.path.basename(filename) in out_subdir)
filepath = os.path.join(self.workdir, filename)
- self._check_permissions(filepath,
- ((stat.S_IRGRP, True),
- (stat.S_IWGRP, False),
- (stat.S_IXGRP, False)))
- self._check_permissions(filepath,
- ((stat.S_IRUSR, True),
- (stat.S_IWUSR, True),
- (stat.S_IXUSR, False)))
- self._check_permissions(filepath,
- ((stat.S_IROTH, False),
- (stat.S_IWOTH, False),
- (stat.S_IXOTH, False)))
+ if checkPerms:
+ self._check_permissions(filepath,
+ ((stat.S_IRGRP, True),
+ (stat.S_IWGRP, False),
+ (stat.S_IXGRP, False)))
+ self._check_permissions(filepath,
+ ((stat.S_IRUSR, True),
+ (stat.S_IWUSR, True),
+ (stat.S_IXUSR, False)))
+ self._check_permissions(filepath,
+ ((stat.S_IROTH, False),
+ (stat.S_IWOTH, False),
+ (stat.S_IXOTH, False)))
with open(filepath, "r") as fd:
content = fd.read()
self.assertEqual(content, self.expected_results[filename])
@@ -170,7 +171,7 @@
m = storage.mount.Mount(floppy, self.workdir)
m.mount(mntOpts='loop')
try:
- self._check_content()
+ self._check_content(checkPerms=False)
self._check_label(floppy, label)
finally:
m.umount(force=True)
--
To view, visit http://gerrit.ovirt.org/22816
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9c14b3cc0538e2f8b09ea99a185ec86e067217f6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
10 years, 4 months
Change in vdsm[ovirt-3.3]: vdsm: prepareVolumePath payload misdetection fix
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: vdsm: prepareVolumePath payload misdetection fix
......................................................................
vdsm: prepareVolumePath payload misdetection fix
The changeset http://gerrit.ovirt.org/#/c/22324/3
used a condition too broad for its check, causing
a device path misdetection when cloud-init is used.
It is triggered in the following case:
specParams vmPayload attribute has
"file"(with content), path" non existent.
Device's (drive's) "path" is set to ''.
The code then consider the cdrom with vmPayload
a case of empty CDROM and creating it as such.
It did work before because the condition results
false when there is no 'path' in drive['specParams']
(which is the case here) and goes to the
next condition section (the right one with payload handling)
This patch provides a band-aid fix to the issue
by tightening the prepareVolumePath check.
Change-Id: Ie847eb92f28d24f4d8189e03a47cd64cc6597363
Bug-Url: https://bugzilla.redhat.com/1047356
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/clientIF.py
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/35/22935/1
diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index e8fb8d1..b101896 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -308,7 +308,8 @@
# next line can be removed in future, when < 3.3 engine
# is not supported
drive['specParams'].get('path', '') == '' and
- drive.get('path', '') == ''):
+ drive.get('path', '') == '' and
+ 'vmPayload' not in drive['specParams']):
volPath = ''
# ... or load the drive from vmPayload:
--
To view, visit http://gerrit.ovirt.org/22935
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie847eb92f28d24f4d8189e03a47cd64cc6597363
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
10 years, 4 months
Change in vdsm[ovirt-3.3]: vdsm: prepareVolumePath payload misdetection fix
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: vdsm: prepareVolumePath payload misdetection fix
......................................................................
vdsm: prepareVolumePath payload misdetection fix
The changeset http://gerrit.ovirt.org/#/c/22324/3
used a condition too broad for its check, causing
a device path misdetection when cloud-init is used.
This in turn makes vdsm to produce an invalid xml
with duplicate cdrom IDs, culminating in a qemu
failure at start.
See the buzilla linked below for a full description
of a misbehaviour.
This patch provides a band-aid fix to the issue
by tightening the prepareVolumePath check.
Bug-Url: https://bugzilla.redhat.com/1047356
Change-Id: I46292f902badca75253b7f766fc596cd92a7be88
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/clientIF.py
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/23/22923/1
diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index e8fb8d1..b101896 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -308,7 +308,8 @@
# next line can be removed in future, when < 3.3 engine
# is not supported
drive['specParams'].get('path', '') == '' and
- drive.get('path', '') == ''):
+ drive.get('path', '') == '' and
+ 'vmPayload' not in drive['specParams']):
volPath = ''
# ... or load the drive from vmPayload:
--
To view, visit http://gerrit.ovirt.org/22923
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I46292f902badca75253b7f766fc596cd92a7be88
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
10 years, 4 months
Change in vdsm[master]: vdsm: prepareVolumePath payload misdetection fix
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: vdsm: prepareVolumePath payload misdetection fix
......................................................................
vdsm: prepareVolumePath payload misdetection fix
The changeset http://gerrit.ovirt.org/#/c/22324/3
used a condition too broad for its check, causing
a device path misdetection when cloud-init is used.
This in turn makes vdsm to produce an invalid xml
with duplicate cdrom IDs, culminating in a qemu
failure at start.
See the buzilla linked below for a full description
of a misbehaviour.
This patch provides a band-aid fix to the issue
by tightening the prepareVolumePath check.
Change-Id: Ie847eb92f28d24f4d8189e03a47cd64cc6597363
Bug-Url: https://bugzilla.redhat.com/1047356
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/clientIF.py
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/25/22925/1
diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index 7e6fcf8..8e7f5f4 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -278,7 +278,8 @@
# next line can be removed in future, when < 3.3 engine
# is not supported
drive['specParams'].get('path', '') == '' and
- drive.get('path', '') == ''):
+ drive.get('path', '') == '' and
+ 'vmPayload' not in drive['specParams']):
volPath = ''
# ... or load the drive from vmPayload:
--
To view, visit http://gerrit.ovirt.org/22925
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie847eb92f28d24f4d8189e03a47cd64cc6597363
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
10 years, 4 months
Change in vdsm[master]: vdsm_hooks/hostusb: Allow multiple usb devices with same ven...
by fromani@redhat.com
Francesco Romani has posted comments on this change.
Change subject: vdsm_hooks/hostusb: Allow multiple usb devices with same vendor and product id
......................................................................
Patch Set 11:
(2 comments)
....................................................
File vdsm_hooks/hostusb/after_vm_destroy.py
Line 67: usefilter = False
Line 68:
Line 69: for usb in os.environ['hostusb'].split('&'):
Line 70:
Line 71: if usb.find('@') != -1:
I have a preference for
'@' in usb
Line 72: usbvp, filter = usb.split('@')
Line 73: vendorid, productid = usbvp.split(':')
Line 74: fbusid, fphydevid = filter.split(':')
Line 75: usefilter = True
....................................................
File vdsm_hooks/hostusb/before_vm_start.py
Line 121: devices = domxml.getElementsByTagName('devices')[0]
Line 122:
Line 123: for usb in os.environ['hostusb'].split('&'):
Line 124:
Line 125: if usb.find('@') != -1:
same here imo better '@' in usb
Line 126: usbvp, filter = usb.split('@')
Line 127: vendorid, productid = usbvp.split(':')
Line 128: fbusid, fphydevid = filter.split(':')
Line 129: usefilter = True
--
To view, visit http://gerrit.ovirt.org/14237
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I831d047e5a2284dcc2e4db7608a9831e64f9c8dc
Gerrit-PatchSet: 11
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: David Guglielmi <david.guglielmi(a)gmail.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: David Guglielmi <david.guglielmi(a)gmail.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Itamar Heim <iheim(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpoledni(a)redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
10 years, 4 months
Change in vdsm[master]: sourceRouteThread: Encapsulate inotify thread
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: sourceRouteThread: Encapsulate inotify thread
......................................................................
sourceRouteThread: Encapsulate inotify thread
sourceRouteThread defined a main function for the inotify thread, but
the thread was created and started from supervdsmServer main function.
This couple these modules, expose module implementation details, and
make both sourceRouteThread and supervdsmServer harder to understand and
maintain.
This patch move inotify thread creation boilerplate from supervdsmServer
main function to a start function in sourceRouteThread module. The
inotify thread main function is private now, unlikely to be used from
other modules by mistake.
A nice side effect is shortening the too-big-and-growing try-block in
supervdsmServer main.
Change-Id: I38e1d402ac1c1cd4de4c3e74910244b47e7977f0
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/sourceRouteThread.py
M vdsm/supervdsmServer
2 files changed, 15 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/23/22723/1
diff --git a/vdsm/sourceRouteThread.py b/vdsm/sourceRouteThread.py
index c913220..b7ba568 100644
--- a/vdsm/sourceRouteThread.py
+++ b/vdsm/sourceRouteThread.py
@@ -1,5 +1,6 @@
import logging
import os
+import threading
import pyinotify
@@ -10,6 +11,7 @@
SOURCE_ROUTES_FOLDER = P_VDSM_RUN + 'sourceRoutes'
configurator = Iproute2()
+_thread = None
class DHClientEventHandler(pyinotify.ProcessEvent):
@@ -42,7 +44,16 @@
self.process_IN_CLOSE_WRITE_filePath(event.pathname)
-def subscribeToInotifyLoop():
+def start():
+ global _thread
+ assert _thread is None
+ _thread = threading.Thread(target=_subscribeToInotifyLoop,
+ name='sourceRoute')
+ _thread.daemon = True
+ _thread.start()
+
+
+def _subscribeToInotifyLoop():
logging.debug("sourceRouteThread.subscribeToInotifyLoop started")
# Subscribe to pyinotify event
diff --git a/vdsm/supervdsmServer b/vdsm/supervdsmServer
index 408dc4e..b84db27 100755
--- a/vdsm/supervdsmServer
+++ b/vdsm/supervdsmServer
@@ -79,8 +79,8 @@
"%s-%s" + _UDEV_RULE_FILE_EXT
RUN_AS_TIMEOUT = config.getint("irs", "process_pool_timeout")
-
_running = True
+
class Timeout(RuntimeError):
pass
@@ -366,6 +366,7 @@
global _running
_running = False
+
def main(sockfile, pidfile=None):
log = logging.getLogger("SuperVdsm.Server")
@@ -414,11 +415,7 @@
log.debug("Started serving super vdsm object")
- _sourceRouteThread = threading.Thread(
- target=sourceRouteThread.subscribeToInotifyLoop,
- name='sourceRoute')
- _sourceRouteThread.daemon = True
- _sourceRouteThread.start()
+ sourceRouteThread.start()
while _running:
signal.pause()
--
To view, visit http://gerrit.ovirt.org/22723
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I38e1d402ac1c1cd4de4c3e74910244b47e7977f0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
10 years, 4 months
Change in vdsm[master]: supervdsmServer: Run sourceRouteThread in a thread
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: supervdsmServer: Run sourceRouteThread in a thread
......................................................................
supervdsmServer: Run sourceRouteThread in a thread
The current code was running the sourceRouteThread main function in the
main thread instead of starting it in a thread. This probably leads to
bogus message in the supervdsm log. Now the code is doing what is try
to do.
Change-Id: I5eb78b57b9ae6ada9948815020ac3d5ac005d20a
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/supervdsmServer
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/18/22718/1
diff --git a/vdsm/supervdsmServer b/vdsm/supervdsmServer
index 59df478..b3b3bff 100755
--- a/vdsm/supervdsmServer
+++ b/vdsm/supervdsmServer
@@ -407,7 +407,7 @@
log.debug("Started serving super vdsm object")
_sourceRouteThread = threading.Thread(
- target=sourceRouteThread.subscribeToInotifyLoop(),
+ target=sourceRouteThread.subscribeToInotifyLoop,
name='sourceRoute')
_sourceRouteThread.daemon = True
_sourceRouteThread.start()
--
To view, visit http://gerrit.ovirt.org/22718
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5eb78b57b9ae6ada9948815020ac3d5ac005d20a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
10 years, 4 months
Change in vdsm[master]: sourceRouteThread: log unhandled exceptions
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: sourceRouteThread: log unhandled exceptions
......................................................................
sourceRouteThread: log unhandled exceptions
Change-Id: I23eaf7a41c8decaea64a392d58ef6ba31f24d795
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M vdsm/sourceRouteThread.py
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/70/22670/1
diff --git a/vdsm/sourceRouteThread.py b/vdsm/sourceRouteThread.py
index c913220..8257fa3 100644
--- a/vdsm/sourceRouteThread.py
+++ b/vdsm/sourceRouteThread.py
@@ -6,6 +6,7 @@
from netconf.iproute2 import Iproute2
from sourceRoute import DynamicSourceRoute
from vdsm.constants import P_VDSM_RUN
+from vdsm import utils
SOURCE_ROUTES_FOLDER = P_VDSM_RUN + 'sourceRoutes'
@@ -42,6 +43,7 @@
self.process_IN_CLOSE_WRITE_filePath(event.pathname)
+(a)utils.traceback
def subscribeToInotifyLoop():
logging.debug("sourceRouteThread.subscribeToInotifyLoop started")
--
To view, visit http://gerrit.ovirt.org/22670
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I23eaf7a41c8decaea64a392d58ef6ba31f24d795
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
10 years, 4 months
Change in vdsm[master]: vdsm: Log unhandled exception for clientIF
by Maor Lipchuk
Maor Lipchuk has uploaded a new change for review.
Change subject: vdsm: Log unhandled exception for clientIF
......................................................................
vdsm: Log unhandled exception for clientIF
Adding a traceback log for unhandled exceptions,
when openning a new thread, so it will not die silently.
Change-Id: I595902fd9d7b62879a4466d4f8deae55a0ed7580
Signed-off-by: Maor Lipchuk <mlipchuk(a)redhat.com>
---
M vdsm/clientIF.py
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/12/22812/1
diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index 7e6fcf8..584d77d 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -376,6 +376,7 @@
(vmParams['vmId'], container_len))
return {'status': doneCode, 'vmList': vm.status()}
+ @utils.traceback(on=self.log.name)
def _recoverThread(self):
# Trying to run recover process until it works. During that time vdsm
# stays in recovery mode (_recover=True), means all api requests
--
To view, visit http://gerrit.ovirt.org/22812
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I595902fd9d7b62879a4466d4f8deae55a0ed7580
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipchuk(a)redhat.com>
10 years, 4 months