Change in vdsm[master]: tool: change configurators from classes to modules.
by mtayer@redhat.com
mooli tayer has posted comments on this change.
Change subject: tool: change configurators from classes to modules.
......................................................................
Patch Set 3:
(2 comments)
http://gerrit.ovirt.org/#/c/34047/3/lib/vdsm/tool/configurator.py
File lib/vdsm/tool/configurator.py:
Line 60: initialization.
Line 61:
Line 62: Note: after configure isconfigured should return NOT_SURE or CONFIGURED.
Line 63:
Line 64: removeConf: [optional function]
> Missing \n
done
Line 65: Cleanup vdsm's configuration.
Line 66: """
Line 67:
Line 68:
Line 236:
Line 237: while queue:
Line 238: next_ = queue.popleft()
Line 239: try:
Line 240: requiredNames = getattr(_CONFIGURATORS[next_],
> do alonbl style
yay, done
Line 241: 'requires',
Line 242: frozenset())
Line 243: except KeyError:
Line 244: available = ', '.join(sorted(_CONFIGURATORS))
--
To view, visit http://gerrit.ovirt.org/34047
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iff5d588cfbbcfe0d5f4a90d624d24f21ef4cc580
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Dima Kuznetsov <dkuznets(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
9 years, 5 months
Change in vdsm[master]: utils: Use ovirt node for persist files
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: utils: Use ovirt node for persist files
......................................................................
utils: Use ovirt node for persist files
Change-Id: Ice245d54497862f9fb86cb32acd13b8a790026b2
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M lib/vdsm/utils.py
1 file changed, 9 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/68/33468/1
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index e08ec3c..d619e98 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -53,6 +53,15 @@
from cpopen import CPopen
from . import constants
+try:
+ from ovirt.node.utils.fs import Config
+ cfg = Config()
+ persistFile = cfg.persist
+ del cfg
+except ImportError:
+ persistFile = lambda name: None
+
+
# Buffsize is 1K because I tested it on some use cases and 1K was fastest. If
# you find this number to be a bottleneck in any way you are welcome to change
# it
@@ -141,11 +150,6 @@
logging.warning("Directory: %s already removed", directoryToRemove)
else:
raise
-
-
-def persistFile(name):
- if isOvirtNode():
- execCmd([constants.EXT_PERSIST, name], sudo=True)
def _parseMemInfo(lines):
--
To view, visit http://gerrit.ovirt.org/33468
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice245d54497862f9fb86cb32acd13b8a790026b2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: tool: change configurators from classes to modules.
by smizrahi@redhat.com
Saggi Mizrahi has posted comments on this change.
Change subject: tool: change configurators from classes to modules.
......................................................................
Patch Set 3: Code-Review+2
(2 comments)
http://gerrit.ovirt.org/#/c/34047/3/lib/vdsm/tool/configurator.py
File lib/vdsm/tool/configurator.py:
Line 60: initialization.
Line 61:
Line 62: Note: after configure isconfigured should return NOT_SURE or CONFIGURED.
Line 63:
Line 64: removeConf: [optional function]
Missing \n
Line 65: Cleanup vdsm's configuration.
Line 66: """
Line 67:
Line 68:
Line 236:
Line 237: while queue:
Line 238: next_ = queue.popleft()
Line 239: try:
Line 240: requiredNames = getattr(_CONFIGURATORS[next_],
do alonbl style
Line 241: 'requires',
Line 242: frozenset())
Line 243: except KeyError:
Line 244: available = ', '.join(sorted(_CONFIGURATORS))
--
To view, visit http://gerrit.ovirt.org/34047
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iff5d588cfbbcfe0d5f4a90d624d24f21ef4cc580
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: Dima Kuznetsov <dkuznets(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
9 years, 5 months
Change in vdsm[master]: supervdsm: Switch multiprocessing to CPopen
by dkuznets@redhat.com
Dima Kuznetsov has uploaded a new change for review.
Change subject: supervdsm: Switch multiprocessing to CPopen
......................................................................
supervdsm: Switch multiprocessing to CPopen
Default implementation of multiprocessing.Process used Popen to create
processes, this resulted in zombies being present after the process was
done. This change monkeypatches Process to use cpopen.
Change-Id: I5333caf7a1162c5d783f556bb9204fb74d1ab469
Bug-url: https://bugzilla.redhat.com/show_bug.cgi?id=841486
Signed-off-by: Dima Kuznetsov <dkuznets(a)redhat.com>
---
M vdsm/supervdsmServer
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/15/28915/1
diff --git a/vdsm/supervdsmServer b/vdsm/supervdsmServer
index f9395eb..0a88a21 100755
--- a/vdsm/supervdsmServer
+++ b/vdsm/supervdsmServer
@@ -44,7 +44,9 @@
log.warn("Could not init proper logging", exc_info=True)
from storage import fuser
+import cpopen
from multiprocessing import Pipe, Process
+Process._Popen = cpopen.CPopen
try:
from gluster import listPublicFunctions
_glusterEnabled = True
--
To view, visit http://gerrit.ovirt.org/28915
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5333caf7a1162c5d783f556bb9204fb74d1ab469
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dima Kuznetsov <dkuznets(a)redhat.com>
9 years, 6 months
Change in vdsm[master]: fix broken TestConfigNetwork.testAddNetworkValidation
by ibarkan@redhat.com
Ido Barkan has uploaded a new change for review.
Change subject: fix broken TestConfigNetwork.testAddNetworkValidation
......................................................................
fix broken TestConfigNetwork.testAddNetworkValidation
this was broken after http://gerrit.oveir.org/34538
was merged.
Change-Id: Ic63df1075bfb036a7a0b133111ebb54fd12b6d3e
Signed-off-by: ibarkan <ibarkan(a)redhat.com>
Change-Id: I14a8138b239c1275c67eba6888115d33bf596f05
Signed-off-by: ibarkan <ibarkan(a)redhat.com>
---
M tests/configNetworkTests.py
1 file changed, 6 insertions(+), 18 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/68/34868/1
diff --git a/tests/configNetworkTests.py b/tests/configNetworkTests.py
index 83a4b73..10a5f2a 100644
--- a/tests/configNetworkTests.py
+++ b/tests/configNetworkTests.py
@@ -90,7 +90,12 @@
'fakebr1': {'ports': ['bond00']},
'fakebr2': {'ports': ['eth7.1']}
},
- 'bondings': {'bond00': {'slaves': ['eth5', 'eth6']}}
+ 'bondings': {
+ 'bond00': {
+ 'slaves': ['eth5', 'eth6'],
+ 'cfg': {'BONDING_OPTS': 'mode=802.3ad miimon=150'}
+ }
+ }
}
fakeInfo = netinfo.NetInfo(_netinfo)
@@ -143,23 +148,6 @@
# Test for nic already in a bond.
self._addNetworkWithExc('test', dict(nics=['eth6'], _netinfo=fakeInfo),
errors.ERR_USED_NIC)
-
- # Test for adding a new VLANed bridged network when a non-VLANed
- # bridged network exists
- self._addNetworkWithExc('test', dict(vlan='2', bonding='bond00',
- nics=nics, _netinfo=fakeInfo),
- errors.ERR_BAD_PARAMS)
-
- # Test for adding a new VLANed bridgeless network when a non-VLANed
- # bridged network exists
- self._addNetworkWithExc('test', dict(vlan='2', bonding='bond00',
- nics=nics, bridged=False, _netinfo=fakeInfo),
- errors.ERR_BAD_PARAMS)
-
- # Test for adding a new VLANed bridged network when the interface is in
- # use by any type of networks
- self._addNetworkWithExc('test', dict(nics=['eth7'], _netinfo=fakeInfo),
- errors.ERR_BAD_PARAMS)
# Test for adding a new non-VLANed bridgeless network when a non-VLANed
# bridgeless network exists
--
To view, visit http://gerrit.ovirt.org/34868
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I14a8138b239c1275c67eba6888115d33bf596f05
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan(a)redhat.com>
9 years, 6 months
Change in vdsm[master]: vm: return displayIp as a string in default case
by fkobzik@redhat.com
Frank Kobzik has uploaded a new change for review.
Change subject: vm: return displayIp as a string in default case
......................................................................
vm: return displayIp as a string in default case
Previously, default value of displayInfo.displayIp was number 0. This patch
changes it to string '0' so that it conforms to the schema.
Signed-off-by: Frantisek Kobzik <fkobzik(a)redhat.com>
Change-Id: If211e80d731de27dd5d5154c32dd63bef5c2be2a
---
M vdsm/virt/vm.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/75/34675/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 8b17a03..6b382b4 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -2347,7 +2347,7 @@
'port', GraphicsDevice.LIBVIRT_PORT_AUTOSELECT),
'tlsPort': dev.get(
'tlsPort', GraphicsDevice.LIBVIRT_PORT_AUTOSELECT),
- 'ipAddress': dev.get('specParams', {}).get('displayIp', 0)}
+ 'ipAddress': dev.get('specParams', {}).get('displayIp', '0')}
return {
'displayInfo': [getInfo(dev)
--
To view, visit http://gerrit.ovirt.org/34675
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If211e80d731de27dd5d5154c32dd63bef5c2be2a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Frank Kobzik <fkobzik(a)redhat.com>
9 years, 6 months
Change in vdsm[master]: libvirtconnection: add credentials other then defalut
by shavivi@redhat.com
Shahar Havivi has uploaded a new change for review.
Change subject: libvirtconnection: add credentials other then defalut
......................................................................
libvirtconnection: add credentials other then defalut
Adding username, passwd, and uri for libvirtconnection module -
Enabling to connect to libvirt with other credentials then
the default configuration.
This will be needed by the v2v future patches which will needed to
connect to remove libvirt given a uri.
Change-Id: I3481d56ee19afec14b36b98b412278148b26379e
Signed-off-by: Shahar Havivi <shaharh(a)redhat.com>
---
M lib/vdsm/libvirtconnection.py
1 file changed, 13 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/93/34293/1
diff --git a/lib/vdsm/libvirtconnection.py b/lib/vdsm/libvirtconnection.py
index b1332db..c261977 100644
--- a/lib/vdsm/libvirtconnection.py
+++ b/lib/vdsm/libvirtconnection.py
@@ -77,12 +77,16 @@
__connectionLock = threading.Lock()
-def _open_qemu_connection():
+def _open_qemu_connection(username=None, passwd=None, uri=None):
+ username = constants.SASL_USERNAME if username is None else username
+ passwd = file(constants.P_VDSM_LIBVIRT_PASSWD).readline().rstrip("\n") \
+ if passwd is None else passwd
+ uri = 'qemu:///system' if uri is None else uri
+
def req(credentials, user_data):
- passwd = file(constants.P_VDSM_LIBVIRT_PASSWD).readline().rstrip("\n")
for cred in credentials:
if cred[0] == libvirt.VIR_CRED_AUTHNAME:
- cred[4] = constants.SASL_USERNAME
+ cred[4] = username
elif cred[0] == libvirt.VIR_CRED_PASSPHRASE:
cred[4] = passwd
return 0
@@ -91,15 +95,18 @@
req, None]
libvirtOpen = functools.partial(
- libvirt.openAuth, 'qemu:///system', auth, 0)
+ libvirt.openAuth, uri, auth, 0)
return utils.retry(libvirtOpen, timeout=10, sleep=0.2)
-def get(target=None, killOnFailure=True):
+def get(target=None, killOnFailure=True, username=None, passwd=None, uri=None):
"""Return current connection to libvirt or open a new one.
Use target to get/create the connection object linked to that object.
target must have a callable attribute named 'dispatchLibvirtEvents' which
will be registered as a callback on libvirt events.
+
+ When wanting to connect to a different libvirt connection use the username,
+ passwd and uri parameters
Wrap methods of connection object so that they catch disconnection, and
take the current process down.
@@ -148,7 +155,7 @@
conn = __connections.get(id(target))
if not conn:
log.debug('trying to connect libvirt')
- conn = _open_qemu_connection()
+ conn = _open_qemu_connection(username, passwd, uri)
__connections[id(target)] = conn
setattr(conn, 'pingLibvirt', getattr(conn, 'getLibVersion'))
--
To view, visit http://gerrit.ovirt.org/34293
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3481d56ee19afec14b36b98b412278148b26379e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <shavivi(a)redhat.com>
9 years, 6 months
Change in vdsm[master]: guestagent: Simpler and safer disk mapping hash
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: guestagent: Simpler and safer disk mapping hash
......................................................................
guestagent: Simpler and safer disk mapping hash
Previously diskMapingHash was initialized to the magic value 0, or to
hash of a sorted json dump of the diskMapping dict. Now diskMappingHash
is always a real hash, and is read only.
The hash is computed automatically when the value of guestDiskMapping is
changed, and there is no way to forget to update the hash.
Change-Id: Ia914cf9860cef019b3040a3f034e479e6a93ed97
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M tests/guestagentTests.py
M vdsm/virt/guestagent.py
2 files changed, 28 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/25/34625/1
diff --git a/tests/guestagentTests.py b/tests/guestagentTests.py
index f4f1a35..d9684ae 100644
--- a/tests/guestagentTests.py
+++ b/tests/guestagentTests.py
@@ -193,3 +193,18 @@
# If the message size was within the allowed range
# the message should have been put into the guestInfo dict
self.assertEqual(self.fakeGuestAgent.guestInfo[k], v)
+
+
+class DiskMappingTests(TestCaseBase):
+
+ def setUp(self):
+ self.agent = guestagent.GuestAgent(None, None, None)
+
+ def test_init(self):
+ self.assertEqual(self.agent.guestDiskMapping, {})
+ self.assertTrue(isinstance(self.agent.diskMappingHash, int))
+
+ def test_change_disk_mapping(self):
+ old_hash = self.agent.diskMappingHash
+ self.agent.guestDiskMapping = {'/dev/vda': 'xxx'}
+ self.assertNotEqual(self.agent.diskMappingHash, old_hash)
diff --git a/vdsm/virt/guestagent.py b/vdsm/virt/guestagent.py
index a403b0d..dbada69 100644
--- a/vdsm/virt/guestagent.py
+++ b/vdsm/virt/guestagent.py
@@ -121,7 +121,6 @@
self._stopped = True
self.guestStatus = None
self.guestDiskMapping = {}
- self.diskMappingHash = 0
self.guestInfo = {
'username': user,
'memUsage': 0,
@@ -136,6 +135,19 @@
self._agentTimestamp = 0
self._channelListener = channelListener
self._messageState = MessageState.NORMAL
+
+ @property
+ def guestDiskMapping(self):
+ return self._guestDiskMapping
+
+ @guestDiskMapping.setter
+ def guestDiskMapping(self, value):
+ self._guestDiskMapping = value
+ self._diskMappingHash = hash(json.dumps(value, sort_keys=True))
+
+ @property
+ def diskMappingHash(self):
+ return self._diskMappingHash
def connect(self):
self._prepare_socket()
@@ -303,8 +315,6 @@
disks.append(disk)
self.guestInfo['disksUsage'] = disks
self.guestDiskMapping = args.get('mapping', {})
- self.diskMappingHash = hash(json.dumps(self.guestDiskMapping,
- sort_keys=True))
elif message == 'number-of-cpus':
self.guestInfo['guestCPUCount'] = int(args['count'])
else:
--
To view, visit http://gerrit.ovirt.org/34625
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia914cf9860cef019b3040a3f034e479e6a93ed97
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
9 years, 6 months
Change in vdsm[master]: guestagent: Use new style class
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: guestagent: Use new style class
......................................................................
guestagent: Use new style class
Using old style class is a trap for innocent developers. They do not
support properties in a nasty way, and should be forbidden in vdsm code.
Change-Id: I138ded6cb33d7927b2701606698aaf95ebf39742
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/virt/guestagent.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/24/34624/1
diff --git a/vdsm/virt/guestagent.py b/vdsm/virt/guestagent.py
index 0be7e6b..a403b0d 100644
--- a/vdsm/virt/guestagent.py
+++ b/vdsm/virt/guestagent.py
@@ -109,7 +109,7 @@
Exception.__init__(self, message)
-class GuestAgent ():
+class GuestAgent(object):
MAX_MESSAGE_SIZE = 2 ** 20 # 1 MiB for now
def __init__(self, socketName, channelListener, log, user='Unknown',
--
To view, visit http://gerrit.ovirt.org/34624
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I138ded6cb33d7927b2701606698aaf95ebf39742
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
9 years, 6 months
Change in vdsm[master]: domain_descriptor: More careful falsy check
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: domain_descriptor: More careful falsy check
......................................................................
domain_descriptor: More careful falsy check
Using "if self._devices" works with xml.minidom, but if we switch our xml
library to xml.etree, empty element is considered falsy, which will
create same hash for different xml.
While this may be a non-issue, using "if self._devices is not None" is
more correct and predictable.
Change-Id: Id805237342b3e00334e0e540ce8f4e919cf0107e
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/virt/domain_descriptor.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/23/34623/1
diff --git a/vdsm/virt/domain_descriptor.py b/vdsm/virt/domain_descriptor.py
index 3e567ab..dbd6dca 100644
--- a/vdsm/virt/domain_descriptor.py
+++ b/vdsm/virt/domain_descriptor.py
@@ -27,7 +27,7 @@
self._dom = xml.dom.minidom.parseString(xmlStr)
self._devices = self._firstElementByTagName('devices')
self._devicesHash = hash(self._devices.toxml()
- if self._devices else '')
+ if self._devices is not None else '')
@classmethod
def fromId(cls, uuid):
--
To view, visit http://gerrit.ovirt.org/34623
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id805237342b3e00334e0e540ce8f4e919cf0107e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
9 years, 6 months