Change in vdsm[master]: vdsm: Try to reconnect on vmchannel after timeout
by Vinzenz Feenstra
Vinzenz Feenstra has uploaded a new change for review.
Change subject: vdsm: Try to reconnect on vmchannel after timeout
......................................................................
vdsm: Try to reconnect on vmchannel after timeout
Once a timeout occurred on the channel the socket connection
might be in a disconnected state. Therefore we're trying to
attempt to connect again on timeout.
Change-Id: I8b9b9418e39558d45c97e9545bc9ecc4935f004e
Bug-Url: https://bugzilla.redhat.com/871616
Signed-off-by: Vinzenz Feenstra <vfeenstr(a)redhat.com>
---
M vdsm/guestIF.py
1 file changed, 7 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/77/11977/1
diff --git a/vdsm/guestIF.py b/vdsm/guestIF.py
index 675b78e..fabbabf 100644
--- a/vdsm/guestIF.py
+++ b/vdsm/guestIF.py
@@ -102,13 +102,17 @@
ret = False
try:
self.log.debug("Attempting connection to %s", self._socketName)
- if self._sock.connect_ex(self._socketName) == 0:
+ ret = self._sock.connect_ex(self._socketName)
+ if ret == 0:
self.log.debug("Connected to %s", self._socketName)
self._messageState = MessageState.NORMAL
self._clearReadBuffer()
self._forward('refresh')
self._stopped = False
ret = True
+ else:
+ self.log.debug("Failed to connect to %s with %d",
+ self._socketName, ret)
except socket.error as err:
self.log.debug("Connection attempt failed: %s", err)
return ret
@@ -268,6 +272,8 @@
if self.guestStatus not in ("Powered down", "RebootInProgress"):
self.log.log(logging.TRACE, "Guest connection timed out")
self.guestStatus = None
+ self.log.debug("Attempting to reconnect to channel after timeout")
+ self._connect()
def _clearReadBuffer(self):
self._buffer = []
--
To view, visit http://gerrit.ovirt.org/11977
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8b9b9418e39558d45c97e9545bc9ecc4935f004e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>
11 years, 1 month
Change in vdsm[master]: vdsm: only specify graphics ports as needed for spice
by Vinzenz Feenstra
Vinzenz Feenstra has uploaded a new change for review.
Change subject: vdsm: only specify graphics ports as needed for spice
......................................................................
vdsm: only specify graphics ports as needed for spice
When using display 'QXL' we should set only tlsPort for secure connections
OR port for nonsecure connections not both.
If we have both defined, we get unnecessary connections to the host from
the spice clients because it will connect always to nonsecure ports first.
Another side effect is that we will get events for the disconnects of those
connections to the unsecure port which will cause the users who just connected
to the guest OS and having SSO setup to end up on a locked screen because
we react on the disconnect events from the graphics channel. And signal the
guest agent to lock their screen.
This commit solves this issue.
Change-Id: Ifc866259d4cfa95a3b137dce101ce04f215f9f5a
Bug-Url: https://bugzilla.redhat.com/905930
Signed-off-by: Vinzenz Feenstra <vfeenstr(a)redhat.com>
---
M vdsm/libvirtvm.py
1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/91/12291/1
diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py
index e2ada06..107ccb8 100644
--- a/vdsm/libvirtvm.py
+++ b/vdsm/libvirtvm.py
@@ -804,12 +804,11 @@
<target type='virtio' name='com.redhat.spice.0'/>
</channel>
"""
- graphicsAttrs = {'port': self.conf['displayPort'], 'autoport': 'yes'}
+ graphicsAttrs = {}
if self.conf['display'] == 'vnc':
graphicsAttrs['type'] = 'vnc'
elif 'qxl' in self.conf['display']:
graphicsAttrs['type'] = 'spice'
- graphicsAttrs['tlsPort'] = self.conf['displaySecurePort']
if self.conf.get('keyboardLayout'):
graphicsAttrs['keymap'] = self.conf['keyboardLayout']
@@ -821,9 +820,12 @@
if 'qxl' in self.conf['display']:
if self.conf.get('spiceSecureChannels'):
+ graphicsAttrs['tlsPort'] = self.conf['displaySecurePort']
for channel in self.conf['spiceSecureChannels'].split(','):
graphics.appendChildWithArgs('channel', name=channel[1:],
mode='secure')
+ else:
+ graphicsAttrs['port'] = self.conf['displayPort']
vmc = XMLElement('channel', type='spicevmc')
vmc.appendChildWithArgs('target', type='virtio',
--
To view, visit http://gerrit.ovirt.org/12291
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc866259d4cfa95a3b137dce101ce04f215f9f5a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>
11 years, 1 month
Change in vdsm[master]: vdsm: Delay desktop lock until we are sure it was a disconne...
by Vinzenz Feenstra
Vinzenz Feenstra has uploaded a new change for review.
Change subject: vdsm: Delay desktop lock until we are sure it was a disconnect
......................................................................
vdsm: Delay desktop lock until we are sure it was a disconnect
This is a hack to mitigate the issue of spice-gtk not respecting the
configured secure channels. Spice-gtk is always connecting first to
a non-secure channel and the server tells the client then to connect
to a secure channel. However as a result of this we're getting events
of false positive disconnects and we need to ensure that we're really
having a disconnected client
This timer is supposed to delay the call to lock the desktop of the
guest. And only lock it, if it there was no new connect.
This is detected by the clientIp being set or not.
Change-Id: I6af5cf868dc9caaa07134b2b296d985f06cf15f2
Signed-off-by: Vinzenz Feenstra <vfeenstr(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 18 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/98/13798/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index e327207..1f8fbe4 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -49,6 +49,8 @@
CONSOLE_DEVICES = 'console'
SMARTCARD_DEVICES = 'smartcard'
+_DESKTOP_LOCK_TIMEOUT = 2
+
"""
A module containing classes needed for VM communication.
"""
@@ -822,9 +824,24 @@
if clientIp:
self.conf['clientIp'] = clientIp
+ def _timedDesktopLock(self):
+ if not self.conf.get('clientIp', ''):
+ self.guestAgent.desktopLock()
+
def onDisconnect(self, detail=None):
- self.guestAgent.desktopLock()
self.conf['clientIp'] = ''
+ # This is a hack to mitigate the issue of spice-gtk not respecting the
+ # configured secure channels. Spice-gtk is always connecting first to
+ # a non-secure channel and the server tells the client then to connect
+ # to a secure channel. However as a result of this we're getting events
+ # of false positive disconnects and we need to ensure that we're really
+ # having a disconnected client
+ # This timer is supposed to delay the call to lock the desktop of the
+ # guest. And only lock it, if it there was no new connect.
+ # This is detected by the clientIp being set or not.
+ self._desktopLockTimer = threading.Timer(_DESKTOP_LOCK_TIMEOUT,
+ self._timedDesktopLock)
+ self._desktopLockTimer.start()
def _rtcUpdate(self, timeOffset):
self.log.debug('new rtc offset %s', timeOffset)
--
To view, visit http://gerrit.ovirt.org/13798
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6af5cf868dc9caaa07134b2b296d985f06cf15f2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>
11 years, 1 month
Change in vdsm[master]: Add forceLink() which replaces a link if it already exists.
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: Add forceLink() which replaces a link if it already exists.
......................................................................
Add forceLink() which replaces a link if it already exists.
Reduce the number of fileUtils.safeUnlink() callers.
Change-Id: Idea4ab66cc2954fdb11606daa4a73ad3edb0c7ef
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/fileVolume.py
M vdsm/storage/outOfProcess.py
M vdsm/utils.py
3 files changed, 25 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/23/11423/1
diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py
index e42fbad..245c189 100644
--- a/vdsm/storage/fileVolume.py
+++ b/vdsm/storage/fileVolume.py
@@ -22,17 +22,18 @@
import os
import sanlock
-import storage_exception as se
from vdsm.config import config
+
+from misc import deprecated
from sdc import sdCache
+from threadLocal import vars
+import storage_exception as se
import outOfProcess as oop
import volume
import image
import sd
import misc
-from misc import deprecated
import task
-from threadLocal import vars
LEASE_FILEEXT = ".lease"
LEASE_FILEOFFSET = 0
@@ -232,8 +233,7 @@
dstImgPath)
dstLeasePath = self._getLeaseVolumePath(
os.path.join(dstImgPath, self.volUUID))
- self.oop.fileUtils.safeUnlink(dstLeasePath)
- self.oop.os.link(self._getLeaseVolumePath(), dstLeasePath)
+ self.oop.utils.forceLink(self._getLeaseVolumePath(), dstLeasePath)
def _share(self, dstImgPath):
"""
@@ -243,15 +243,11 @@
dstMetaPath = self._getMetaVolumePath(dstVolPath)
self.log.debug("Share volume %s to %s", self.volUUID, dstImgPath)
-
- self.oop.fileUtils.safeUnlink(dstVolPath)
- self.oop.os.link(self.getVolumePath(), dstVolPath)
+ self.oop.utils.forceLink(self.getVolumePath(), dstVolPath)
self.log.debug("Share volume metadata of %s to %s", self.volUUID,
dstImgPath)
-
- self.oop.fileUtils.safeUnlink(dstMetaPath)
- self.oop.os.link(self._getMetaVolumePath(), dstMetaPath)
+ self.oop.utils.forceLink(self._getMetaVolumePath(), dstMetaPath)
# Link the lease file if the domain uses sanlock
if sdCache.produce(self.sdUUID).hasVolumeLeases():
diff --git a/vdsm/storage/outOfProcess.py b/vdsm/storage/outOfProcess.py
index 1d78277..a445435 100644
--- a/vdsm/storage/outOfProcess.py
+++ b/vdsm/storage/outOfProcess.py
@@ -82,5 +82,6 @@
return _ModuleWrapper("oop", procPool, DEFAULT_TIMEOUT,
(("os",
("path",)),
+ ("vdsm", ("utils",)),
"glob",
"fileUtils"))
diff --git a/vdsm/utils.py b/vdsm/utils.py
index 35338a0..ff25fa3 100644
--- a/vdsm/utils.py
+++ b/vdsm/utils.py
@@ -72,6 +72,23 @@
raise
+def forceLink(src, dst):
+ """ Makes or replaces a hard link.
+
+ Like os.link() but replaces the link if it exists.
+ """
+ try:
+ os.link(src, dst)
+ except OSError as e:
+ if e.errno == errno.EEXIST:
+ rmFile(dst)
+ os.link(src, dst)
+ else:
+ logging.error("Linking file: %s to %s failed", src, dst,
+ exc_info=True)
+ raise
+
+
def readMemInfo():
"""
Parse ``/proc/meminfo`` and return its content as a dictionary.
--
To view, visit http://gerrit.ovirt.org/11423
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idea4ab66cc2954fdb11606daa4a73ad3edb0c7ef
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
11 years, 1 month
Change in vdsm[master]: image: update the volume permissions when needed
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: image: update the volume permissions when needed
......................................................................
image: update the volume permissions when needed
Volumes leaves created in 2.2 did not have the group writeable bit
set. In order to be able to start VMs from old NFS volumes we need
to check (and eventually fix) the group permissions during the volume
preparation.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=911417
Change-Id: I516d8240840e3aa32bd8074420e331b8dc4e6da7
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M tests/fileUtilTests.py
M vdsm/storage/blockSD.py
M vdsm/storage/fileSD.py
M vdsm/storage/fileUtils.py
M vdsm/storage/fileVolume.py
M vdsm/storage/image.py
M vdsm/storage/sd.py
7 files changed, 50 insertions(+), 18 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/31/13331/1
diff --git a/tests/fileUtilTests.py b/tests/fileUtilTests.py
index 8daeff2..8cdad4c 100644
--- a/tests/fileUtilTests.py
+++ b/tests/fileUtilTests.py
@@ -177,3 +177,24 @@
fileUtils.chown(srcPath, "root", "root")
stat = os.stat(srcPath)
self.assertTrue(stat.st_uid == stat.st_gid == 0)
+
+
+class CopyUserModeToGroupTests(TestCaseBase):
+ MODE_MASK = 0777
+
+ # format: initialMode, expectedMode
+ modesList = [
+ (0770, 0770), (0700, 0770), (0750, 0770), (0650, 0660),
+ ]
+
+ def testCopyUserModeToGroup(self):
+ fd, path = tempfile.mkstemp()
+ try:
+ os.close(fd)
+ for initialMode, expectedMode in self.modesList:
+ os.chmod(path, initialMode)
+ fileUtils.copyUserModeToGroup(path)
+ self.assertEquals(os.stat(path).st_mode & self.MODE_MASK,
+ expectedMode)
+ finally:
+ os.unlink(path)
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 9809bf4..43b2389 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -1001,13 +1001,13 @@
"""
return getAllVolumes(self.sdUUID)
- def activateVolumes(self, volUUIDs):
+ def activateVolumes(self, imgUUID, volUUIDs):
"""
Activate all the volumes listed in volUUIDs
"""
lvm.activateLVs(self.sdUUID, volUUIDs)
- def deactivateVolumes(self, volUUIDs):
+ def deactivateVolumes(self, imgUUID, volUUIDs):
"""
Deactivate all the volumes listed in volUUIDs
"""
diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py
index be2a793..d71ec66 100644
--- a/vdsm/storage/fileSD.py
+++ b/vdsm/storage/fileSD.py
@@ -410,6 +410,16 @@
return dict((k, sd.ImgsPar(tuple(v['imgs']), v['parent']))
for k, v in volumes.iteritems())
+ def activateVolumes(self, imgUUID, volUUIDs):
+ """
+ Activate all the volumes listed in volUUIDs
+ """
+ # Volumes leaves created in 2.2 did not have group writeable bit
+ # set. We have to set it here if we want qemu-kvm to write to old
+ # NFS volumes.
+ vol = self.produceVolume(imgUUID, volUUIDs[-1])
+ self.oop.fileUtils.copyUserModeToGroup(vol.getVolumePath())
+
@classmethod
def format(cls, sdUUID):
"""
diff --git a/vdsm/storage/fileUtils.py b/vdsm/storage/fileUtils.py
index d5e5faf..519c918 100644
--- a/vdsm/storage/fileUtils.py
+++ b/vdsm/storage/fileUtils.py
@@ -409,3 +409,12 @@
os.fsync(fd)
finally:
os.close(fd)
+
+
+def copyUserModeToGroup(path):
+ mode = os.stat(path).st_mode
+ userMode = mode & 0700 # user mode mask
+ newGroupMode = userMode >> 3
+ if (mode & 0070) != newGroupMode: # group mode mask
+ # setting the new group mode masking out the original one
+ os.chmod(path, (mode & 0707) | newGroupMode)
diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py
index 01575e0..1c9946b 100644
--- a/vdsm/storage/fileVolume.py
+++ b/vdsm/storage/fileVolume.py
@@ -281,20 +281,12 @@
"""
Make volume accessible as readonly (internal) or readwrite (leaf)
"""
- def copyUserModeToGroup(path):
- # Volumes leaves created in 2.2 did not have group writeable bit
- # set. We have to set it here if we want qemu-kvm to write to old
- # NFS volumes.
- mode = self.oop.os.stat(path).st_mode
- usrmode = (mode & 0700) >> 3
- grpmode = mode & 0070
- if usrmode & grpmode != usrmode:
- mode |= usrmode
- self.oop.os.chmod(path, mode)
-
volPath = self.getVolumePath()
- copyUserModeToGroup(volPath)
+ # Volumes leaves created in 2.2 did not have group writeable bit
+ # set. We have to set it here if we want qemu-kvm to write to old
+ # NFS volumes.
+ self.oop.fileUtils.copyUserModeToGroup(volPath)
if setrw:
self.setrw(rw=rw)
diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py
index 92021ff..ba49b8e 100644
--- a/vdsm/storage/image.py
+++ b/vdsm/storage/image.py
@@ -354,7 +354,7 @@
# Activating the volumes
sdCache.produce(sdUUID).activateVolumes(
- volUUIDs=[vol.volUUID for vol in chain])
+ imgUUID, volUUIDs=[vol.volUUID for vol in chain])
return chain
@@ -363,7 +363,7 @@
# Deactivating the volumes
sdCache.produce(sdUUID).deactivateVolumes(
- volUUIDs=[vol.volUUID for vol in chain])
+ imgUUID, volUUIDs=[vol.volUUID for vol in chain])
# Do not deactivate the template yet (might be in use by an other vm)
# TODO: reference counting to deactivate when unused
diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py
index 48ee7d5..c1da6a5 100644
--- a/vdsm/storage/sd.py
+++ b/vdsm/storage/sd.py
@@ -626,13 +626,13 @@
"""
pass
- def activateVolumes(self, volUUIDs):
+ def activateVolumes(self, imgUUID, volUUIDs):
"""
Activate all the volumes listed in volUUIDs
"""
pass
- def deactivateVolumes(self, volUUIDs):
+ def deactivateVolumes(self, imgUUID, volUUIDs):
"""
Deactivate all the volumes listed in volUUIDs
"""
--
To view, visit http://gerrit.ovirt.org/13331
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I516d8240840e3aa32bd8074420e331b8dc4e6da7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
11 years, 1 month
Change in vdsm[master]: Remove fileUtils.cleanupfiles().
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: Remove fileUtils.cleanupfiles().
......................................................................
Remove fileUtils.cleanupfiles().
Racy, redundant, named out of convention, ...
Change-Id: I2dbb22ea97b1a6b2d572d21a5c4267fe78759e7f
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/fileUtils.py
M vdsm/storage/fileVolume.py
2 files changed, 9 insertions(+), 18 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/25/11425/1
diff --git a/vdsm/storage/fileUtils.py b/vdsm/storage/fileUtils.py
index 440974c..86f6e1a 100644
--- a/vdsm/storage/fileUtils.py
+++ b/vdsm/storage/fileUtils.py
@@ -129,15 +129,6 @@
return os.access(filename, check)
-def cleanupfiles(filelist):
- """
- Removes the files in the list
- """
- for item in filelist:
- if os.path.lexists(item):
- os.remove(item)
-
-
def cleanupdir(dirPath, ignoreErrors=True):
"""
Recursively remove all the files and directories in the given directory
diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py
index ef1443a..ae65c8f 100644
--- a/vdsm/storage/fileVolume.py
+++ b/vdsm/storage/fileVolume.py
@@ -54,15 +54,14 @@
def deleteMultipleVolumes(sdUUID, volumes, postZero):
# Posix asserts that the blocks will be zeroed before reuse
- volPaths = []
for vol in volumes:
vol.setLegality(volume.ILLEGAL_VOL)
- volPaths.append(vol.getVolumePath())
- try:
- oop.getGlobalProcPool().fileUtils.cleanupfiles(volPaths)
- except OSError:
- volume.log.error("cannot delete some volumes at paths: %s",
- volPaths, exc_info=True)
+ volPath = vol.getVolumePath()
+ try:
+ oop.getGlobalProcPool().utils.rmFile(volPath)
+ except OSError:
+ volume.log.error("cannot delete volume at path: %s",
+ volPath, exc_info=True)
class FileVolume(volume.Volume):
@@ -202,8 +201,9 @@
puuid, exc_info=True)
try:
- self.oop.fileUtils.cleanupfiles([vol_path, lease_path])
- except Exception as e:
+ self.oop.utils.rmFile(vol_path)
+ self.oop.utils.rmFile(lease_path)
+ except OSError as e:
eFound = e
self.log.error("cannot delete volume %s at path: %s", self.volUUID,
vol_path, exc_info=True)
--
To view, visit http://gerrit.ovirt.org/11425
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2dbb22ea97b1a6b2d572d21a5c4267fe78759e7f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
11 years, 1 month
Change in vdsm[master]: Remove fileUtils.safeUnlink().
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: Remove fileUtils.safeUnlink().
......................................................................
Remove fileUtils.safeUnlink().
safeUnlink() usage replaced by utils.rmFile() calls.
Change-Id: I8d6531bdf43aa9ed74dff5a54a54bb476500298e
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/blockVolume.py
M vdsm/storage/fileUtils.py
M vdsm/storage/fileVolume.py
3 files changed, 6 insertions(+), 16 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/24/11424/1
diff --git a/vdsm/storage/blockVolume.py b/vdsm/storage/blockVolume.py
index 355e961..cfc1dc9 100644
--- a/vdsm/storage/blockVolume.py
+++ b/vdsm/storage/blockVolume.py
@@ -24,6 +24,7 @@
import sanlock
from vdsm.config import config
+import vdsm.utils as utils
import storage_exception as se
import volume
import image
@@ -166,7 +167,7 @@
lvm.createLV(dom.sdUUID, volUUID, volSize, activate=True,
initialTag=TAG_VOL_UNINIT)
- fileUtils.safeUnlink(volPath)
+ utils.rmFile(volPath)
os.symlink(lvm.lvPath(dom.sdUUID, volUUID), volPath)
if not volParent:
@@ -335,7 +336,7 @@
@classmethod
def shareVolumeRollback(cls, taskObj, volPath):
cls.log.info("Volume rollback for volPath=%s", volPath)
- fileUtils.safeUnlink(volPath)
+ utils.rmFile(volPath)
@deprecated # valid only for domain version < 3, see volume.setrw
def _setrw(self, rw):
diff --git a/vdsm/storage/fileUtils.py b/vdsm/storage/fileUtils.py
index b9e348b..440974c 100644
--- a/vdsm/storage/fileUtils.py
+++ b/vdsm/storage/fileUtils.py
@@ -129,17 +129,6 @@
return os.access(filename, check)
-def safeUnlink(filename):
- """
- Remove a file and skip the exception if the file is missing (ENOENT)
- """
- try:
- os.unlink(filename)
- except OSError as e:
- if e.errno != os.errno.ENOENT:
- raise
-
-
def cleanupfiles(filelist):
"""
Removes the files in the list
diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py
index 245c189..ef1443a 100644
--- a/vdsm/storage/fileVolume.py
+++ b/vdsm/storage/fileVolume.py
@@ -257,9 +257,9 @@
def shareVolumeRollback(cls, taskObj, volPath):
cls.log.info("Volume rollback for volPath=%s", volPath)
procPool = oop.getProcessPool(getDomUuidFromVolumePath(volPath))
- procPool.fileUtils.safeUnlink(volPath)
- procPool.fileUtils.safeUnlink(cls.__metaVolumePath(volPath))
- procPool.fileUtils.safeUnlink(cls.__leaseVolumePath(volPath))
+ procPool.utils.rmFile(volPath)
+ procPool.utils.rmFile(cls.__metaVolumePath(volPath))
+ procPool.utils.rmFile(cls.__leaseVolumePath(volPath))
@deprecated # valid only for domain version < 3, see volume.setrw
def _setrw(self, rw):
--
To view, visit http://gerrit.ovirt.org/11424
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8d6531bdf43aa9ed74dff5a54a54bb476500298e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
11 years, 1 month
Change in vdsm[master]: Bond destroying
by psebek@redhat.com
Petr Šebek has uploaded a new change for review.
Change subject: Bond destroying
......................................................................
Bond destroying
If there is deleted network with bond other than bond[0-4] and no
other network is using that bond, the bond is destroyed. It prevents
accumulation poorly named bonds.
Change-Id: I0cd27f1ff9a62e202c3513e54df5481d1b72ed7c
Bug-Url: https://bugzilla.redhat.com/928442
Signed-off-by: Petr Sebek <psebek(a)redhat.com>
---
M vdsm/configNetwork.py
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/52/13752/1
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index 2a85e34..dd362c1 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -516,6 +516,10 @@
def removeBonding(self, bonding):
self._backup(netinfo.NET_CONF_PREF + bonding)
self._removeFile(netinfo.NET_CONF_PREF + bonding)
+ if bonding not in ['bond0', 'bond1', 'bond2', 'bond3', 'bond4']:
+ with open(BONDING_MASTERS, 'w') as f:
+ f.write("-%s\n" % bonding)
+
def removeBridge(self, bridge):
ifdown(bridge)
--
To view, visit http://gerrit.ovirt.org/13752
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0cd27f1ff9a62e202c3513e54df5481d1b72ed7c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Šebek <psebek(a)redhat.com>
11 years, 1 month
Change in vdsm[master]: Use 'ip link' to get different kinds of interfaces
by wudxw@linux.vnet.ibm.com
Mark Wu has uploaded a new change for review.
Change subject: Use 'ip link' to get different kinds of interfaces
......................................................................
Use 'ip link' to get different kinds of interfaces
It's a little faster than listing the dir '/sys/class/net'
Change-Id: Iecc2300963fe1834defb99f5be92b25c0218cf00
Signed-off-by: Mark Wu <wudxw(a)linux.vnet.ibm.com>
---
M tests/netinfoTests.py
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/68/13668/1
diff --git a/tests/netinfoTests.py b/tests/netinfoTests.py
index 5e0716e..016d68a 100644
--- a/tests/netinfoTests.py
+++ b/tests/netinfoTests.py
@@ -43,12 +43,12 @@
def testSpeedInvalidNic(self):
nicName = 'DUMMYNICDEVNAME'
- self.assertTrue(nicName not in netinfo.nics())
+ self.assertTrue(nicName not in netinfo.getInterfaces()[0])
s = netinfo.speed(nicName)
self.assertEqual(s, 0)
def testSpeedInRange(self):
- for d in netinfo.nics():
+ for d in netinfo.getInterfaces()[0]:
s = netinfo.speed(d)
self.assertFalse(s < 0)
self.assertTrue(s in ETHTOOL_SPEEDS or s == 0)
--
To view, visit http://gerrit.ovirt.org/13668
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iecc2300963fe1834defb99f5be92b25c0218cf00
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mark Wu <wudxw(a)linux.vnet.ibm.com>
11 years, 1 month
Change in vdsm[master]: doc: doc generation fix, another attempt.
by gvallare@redhat.com
Giuseppe Vallarelli has abandoned this change.
Change subject: doc: doc generation fix, another attempt.
......................................................................
Patch Set 1: Abandoned
--
To view, visit http://gerrit.ovirt.org/11661
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: abandon
Gerrit-Change-Id: I76065019f94f332033cb79412e1c1564b5a095fd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Vallarelli <gvallare(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
11 years, 1 month