Change in vdsm[master]: netconf: Fix the mtu of bond and nic can't be set for new ne...
by wudxw@linux.vnet.ibm.com
Mark Wu has uploaded a new change for review.
Change subject: netconf: Fix the mtu of bond and nic can't be set for new network
......................................................................
netconf: Fix the mtu of bond and nic can't be set for new network
The configuring should not be skipped if the new vlaned network
over the bond or nic has a bigger mtu than current.
Change-Id: Id7a1f5b628261ae4ebf400494bcdb2939a9cd534
Signed-off-by: Mark Wu <wudxw(a)linux.vnet.ibm.com>
---
M tests/functional/networkTests.py
M vdsm/netmodels.py
2 files changed, 120 insertions(+), 27 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/66/18966/1
diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py
index 94dd0e8..431dfae 100644
--- a/tests/functional/networkTests.py
+++ b/tests/functional/networkTests.py
@@ -1013,48 +1013,62 @@
{})
self.assertEquals(status, SUCCESS, msg)
+ def _createBondedNetAndCheck(self, netNum, bondDict, bridged,
+ **networkOpts):
+ netName = NETWORK_NAME + str(netNum)
+ networks = {netName: dict(bonding=BONDING_NAME, bridged=bridged,
+ vlan=str(int(VLAN_ID) + netNum),
+ **networkOpts)}
+ status, msg = self.vdsm_net.setupNetworks(networks,
+ {BONDING_NAME: bondDict},
+ {})
+ self.assertEquals(status, SUCCESS, msg)
+ self.vdsm_net.networkExists(netName, bridged=bridged)
+ self.vdsm_net.bondExists(BONDING_NAME, bondDict['nics'])
+ if 'mtu' in networkOpts:
+ self.assertEquals(networkOpts['mtu'],
+ self.vdsm_net.getMtu(netName))
+
@cleanupNet
@permutations([[True], [False]])
@RequireDummyMod
@ValidateRunningAsRoot
def testSetupNetworksStableBond(self, bridged):
- def createBondedNetAndCheck(netNum, bondDict):
- netName = NETWORK_NAME + str(netNum)
- networks = {netName: dict(bonding=BONDING_NAME, bridged=bridged,
- vlan=str(int(VLAN_ID) + netNum))}
- status, msg = self.vdsm_net.setupNetworks(networks,
- {BONDING_NAME: bondDict},
- {})
- self.assertEquals(status, SUCCESS, msg)
- self.vdsm_net.networkExists(netName, bridged=bridged)
- self.vdsm_net.bondExists(BONDING_NAME, bondDict['nics'])
-
with dummyIf(3) as nics:
with self.vdsm_net.pinger():
# Add initial vlanned net over bond
- createBondedNetAndCheck(0, {'nics': nics[:2],
- 'options': 'mode=3 miimon=250'})
+ self._createBondedNetAndCheck(0, {'nics': nics[:2],
+ 'options': 'mode=3 miimon=250'},
+ bridged)
with nonChangingOperstate(BONDING_NAME):
# Add additional vlanned net over the bond
- createBondedNetAndCheck(1,
- {'nics': nics[:2],
- 'options': 'mode=3 miimon=250'})
+ self._createBondedNetAndCheck(1,
+ {'nics': nics[:2],
+ 'options':
+ 'mode=3 miimon=250'},
+ bridged)
# Add additional vlanned net over the increasing bond
- createBondedNetAndCheck(2,
- {'nics': nics,
- 'options': 'mode=3 miimon=250'})
+ self._createBondedNetAndCheck(2,
+ {'nics': nics,
+ 'options':
+ 'mode=3 miimon=250'},
+ bridged)
# Add additional vlanned net over the changing bond
- createBondedNetAndCheck(3,
- {'nics': nics[1:],
- 'options': 'mode=3 miimon=250'})
+ self._createBondedNetAndCheck(3,
+ {'nics': nics[1:],
+ 'options':
+ 'mode=3 miimon=250'},
+ bridged)
# Add a network changing bond options
with self.assertRaises(OperStateChangedError):
with nonChangingOperstate(BONDING_NAME):
- createBondedNetAndCheck(4,
- {'nics': nics[1:],
- 'options': 'mode=4 miimon=9'})
+ self._createBondedNetAndCheck(4,
+ {'nics': nics[1:],
+ 'options':
+ 'mode=4 miimon=9'},
+ bridged)
# cleanup
networks = dict((NETWORK_NAME + str(num), {'remove': True}) for
@@ -1067,6 +1081,81 @@
@cleanupNet
@permutations([[True], [False]])
+ @RequireDummyMod
+ @ValidateRunningAsRoot
+ def testSetupNetworksMultiMTUsOverBond(self, bridged):
+ with dummyIf(2) as nics:
+ with self.vdsm_net.pinger():
+ # Add initial vlanned net over bond
+ self._createBondedNetAndCheck(0, {'nics': nics}, bridged,
+ mtu='1500')
+ self.assertEquals('1500',
+ self.vdsm_net.getMtu(BONDING_NAME))
+
+ with nonChangingOperstate(BONDING_NAME):
+ # Add a network with MTU smaller than existing network
+ self._createBondedNetAndCheck(1, {'nics': nics},
+ bridged, mtu='1400')
+ self.assertEquals('1500',
+ self.vdsm_net.getMtu(BONDING_NAME))
+
+ # Add a network with MTU bigger than existing network
+ self._createBondedNetAndCheck(2, {'nics': nics},
+ bridged, mtu='1600')
+ self.assertEquals('1600',
+ self.vdsm_net.getMtu(BONDING_NAME))
+
+ # cleanup
+ networks = dict((NETWORK_NAME + str(num), {'remove': True}) for
+ num in range(3))
+ status, msg = self.vdsm_net.setupNetworks(networks,
+ {BONDING_NAME:
+ dict(remove=True)},
+ {})
+ self.assertEquals(status, SUCCESS, msg)
+
+ def _createVlanedNetOverNicAndCheck(self, netNum, bridged, **networkOpts):
+ netName = NETWORK_NAME + str(netNum)
+ networks = {netName: dict(bridged=bridged,
+ vlan=str(int(VLAN_ID) + netNum),
+ **networkOpts)}
+ status, msg = self.vdsm_net.setupNetworks(networks, {}, {})
+ self.assertEquals(status, SUCCESS, msg)
+ self.vdsm_net.networkExists(netName, bridged=bridged)
+ if 'mtu' in networkOpts:
+ self.assertEquals(networkOpts['mtu'],
+ self.vdsm_net.getMtu(netName))
+
+ @cleanupNet
+ @permutations([[True], [False]])
+ @RequireDummyMod
+ @ValidateRunningAsRoot
+ def testSetupNetworksMultiMTUsOverNic(self, bridged):
+ with dummyIf(1) as nics:
+ nic, = nics
+ with self.vdsm_net.pinger():
+ # Add initial vlanned net over bond
+ self._createVlanedNetOverNicAndCheck(0, bridged, nic=nic,
+ mtu='1500')
+ self.assertEquals('1500', self.vdsm_net.getMtu(nic))
+
+ # Add a network with MTU smaller than existing network
+ self._createVlanedNetOverNicAndCheck(1, bridged, nic=nic,
+ mtu='1400')
+ self.assertEquals('1500', self.vdsm_net.getMtu(nic))
+
+ # Add a network with MTU bigger than existing network
+ self._createVlanedNetOverNicAndCheck(2, bridged, nic=nic,
+ mtu='1600')
+ self.assertEquals('1600', self.vdsm_net.getMtu(nic))
+
+ # cleanup
+ networks = dict((NETWORK_NAME + str(num), {'remove': True}) for
+ num in range(3))
+ status, msg = self.vdsm_net.setupNetworks(networks, {}, {})
+ self.assertEquals(status, SUCCESS, msg)
+
+ @permutations([[True], [False]])
def testSetupNetworksAddBadParams(self, bridged):
attrs = dict(vlan=VLAN_ID, bridged=bridged)
status, msg = self.vdsm_net.setupNetworks({NETWORK_NAME: attrs},
diff --git a/vdsm/netmodels.py b/vdsm/netmodels.py
index 234386b..ab45d90 100644
--- a/vdsm/netmodels.py
+++ b/vdsm/netmodels.py
@@ -91,8 +91,10 @@
mtu=mtu)
def configure(self, **opts):
- if (not self.vlan or
- netinfo.operstate(self.name) != netinfo.OPERSTATE_UP):
+ if not (self.vlan and
+ netinfo.operstate(self.name) != netinfo.OPERSTATE_UP and
+ (netinfo.NetInfo().ifaceUsers(self.name)
+ and self.mtu <= netinfo.getMtu(self.name))):
self.configurator.configureNic(self, **opts)
def remove(self):
@@ -196,6 +198,8 @@
if not(self.vlan and
self.name in netinfo.bondings() and
netinfo.operstate(self.name) == netinfo.OPERSTATE_UP and
+ (netinfo.NetInfo().ifaceUsers(self.name)
+ and self.mtu <= netinfo.getMtu(self.name)) and
self.areOptionsApplied() and
frozenset(slave.name for slave in self.slaves) ==
frozenset(netinfo.slaves(self.name))):
--
To view, visit http://gerrit.ovirt.org/18966
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id7a1f5b628261ae4ebf400494bcdb2939a9cd534
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mark Wu <wudxw(a)linux.vnet.ibm.com>
10 years, 8 months
Change in vdsm[master]: imageSharing: return proper size in httpGetSize
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: imageSharing: return proper size in httpGetSize
......................................................................
imageSharing: return proper size in httpGetSize
When importing images from OpenStack Glance the Content-Length is 0
so we need to override the value with the content of the custom header
X-Image-Meta-Size.
Change-Id: Icbcc601767d7f5b044b9e0e32f35abccdfb5746b
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/imageSharing.py
1 file changed, 10 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/22/19222/1
diff --git a/vdsm/storage/imageSharing.py b/vdsm/storage/imageSharing.py
index 5db0a4e..26f299a 100644
--- a/vdsm/storage/imageSharing.py
+++ b/vdsm/storage/imageSharing.py
@@ -29,11 +29,18 @@
headers = curlImgWrap.head(methodArgs.get('url'),
methodArgs.get("headers", {}))
+ size = None
+
if 'Content-Length' in headers:
size = int(headers['Content-Length'])
- elif 'X-Image-Meta-Size' in headers:
- size = int(headers['X-Image-Meta-Size'])
- else:
+
+ # OpenStack Glance returns Content-Length = 0 so we need to
+ # override the value with the content of the custom header
+ # X-Image-Meta-Size.
+ if 'X-Image-Meta-Size' in headers:
+ size = max(size, int(headers['X-Image-Meta-Size']))
+
+ if size is None:
raise RuntimeError("Unable to determine image size")
return size
--
To view, visit http://gerrit.ovirt.org/19222
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icbcc601767d7f5b044b9e0e32f35abccdfb5746b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
10 years, 8 months
Change in vdsm[master]: [WIP] AsyncOpFix
by smizrahi@redhat.com
Saggi Mizrahi has uploaded a new change for review.
Change subject: [WIP] AsyncOpFix
......................................................................
[WIP] AsyncOpFix
Change-Id: Ie120c6b241aa45268b8e3d29110b51b39c30af50
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M tests/utilsTests.py
1 file changed, 8 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/59/19259/1
diff --git a/tests/utilsTests.py b/tests/utilsTests.py
index cbe7929..09a9b32 100644
--- a/tests/utilsTests.py
+++ b/tests/utilsTests.py
@@ -93,8 +93,12 @@
return utils.AsyncProcessOperation(proc, parse)
def _sleep(self, t):
- proc = misc.execCmd(["sleep", str(t)], sync=False)
- return utils.AsyncProcessOperation(proc)
+ proc = misc.execCmd(["echo", str(t)], sync=False)
+
+ def parse(rc, out, err):
+ return rc, "", ""
+
+ return utils.AsyncProcessOperation(proc, parse)
def _fail(self, t):
proc = misc.execCmd(["sleep", str(t)], sync=False)
@@ -109,8 +113,8 @@
self.assertEquals(aop.result(), ((0, "", ""), None))
def testAlreadyExitedSuccess(self):
- aop = self._sleep(0)
- time.sleep(1)
+ aop = self._sleep(1)
+ time.sleep(2)
self.assertEquals(aop.result(), ((0, "", ""), None))
def testAlreadyExitedFail(self):
--
To view, visit http://gerrit.ovirt.org/19259
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie120c6b241aa45268b8e3d29110b51b39c30af50
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
10 years, 8 months
Change in vdsm[master]: java_binding: Simplify bindings by using object mappers
by mtayer@redhat.com
mooli tayer has posted comments on this change.
Change subject: java_binding: Simplify bindings by using object mappers
......................................................................
Patch Set 6:
(8 comments)
Review still in process. one general comment:
This patch set is a good opportunity to introduce dependency injection - consider it.
....................................................
File client/java/pom.xml
Line 3: <modelVersion>4.0.0</modelVersion>
Line 4: <groupId>org.ovirt.vdsm</groupId>
Line 5: <artifactId>vdsm-java-client</artifactId>
Line 6: <version>0.0.1-SNAPSHOT</version>
Line 7: <name>vdsm</name>
<name>vdsm client</name> ?
Line 8: <description>vdsm java client</description>
Line 9: <packaging>pom</packaging>
Line 10: <modules>
Line 11: <module>vdsm-json-rpc</module>
....................................................
File client/java/vdsm-api/src/main/java/org/ovirt/vdsm/RequestBuilder.java
Line 5: import org.ovirt.vdsm.jsonrpc.*;
Line 6:
Line 7: public class RequestBuilder {
Line 8:
Line 9: private String _id;
Please be consistent in ordering variables
(e.g static finals first, then finals, then instance variables)
Line 10: private static final ObjectMapper _objMapper;
Line 11: private final ObjectNode _parameters;
Line 12: private final String _methodName;
Line 13:
Line 12: private final String _methodName;
Line 13:
Line 14: static {
Line 15: _objMapper = new ObjectMapper();
Line 16: }
Why not do:
private static final ObjectMapper objMapper = new ObjectMapper();
Line 17:
Line 18: public RequestBuilder(String methodName) {
Line 19: _id = null;
Line 20: _parameters = _objMapper.createObjectNode();
Line 22: }
Line 23:
Line 24: public void id(String id) {
Line 25: _id = id;
Line 26: }
setId() ?
Line 27:
Line 28: public void addParameter(String name, String value) {
Line 29: _parameters.put(name, value);
Line 30: }
Line 50: }
Line 51:
Line 52: public void addParameter(String name, VDSMEnum value) {
Line 53: _parameters.put(name, value.toString());
Line 54: }
Consider
1.) Why not create a nice DSL here:
public RequestBuilder addParameter (String name, VDSMEnum value){
...
return this
}
then you can:
RequestBuilder requestBuilder = new RequestBuilder('kuku')
JsonRpcRequest jrb =requestBuilder.addParameter('pupu',8).
.addParameter('yuhu', 'Hi')
.addParameter('paka', ACTIVE)
.build();
2.)replacing all the above with:
public <T> void addParameter(String name,T value){...}
Calling:
_parameters.put('kuku', 'pupu');
_parameters.put('VDSMEnumVak', BlockDevicePathState.Active.toString());
Line 55:
Line 56: public JsonRpcRequest build() {
Line 57: final TextNode id = _parameters.textNode(_id);
Line 58: return new JsonRpcRequest(_methodName, _parameters, id);
....................................................
File client/java/vdsm-api/src/main/java/org/ovirt/vdsm/VDSMClientBase.java
Line 19: public void close() {
Line 20: _transport.close();
Line 21: }
Line 22:
Line 23: public boolean closed() {
getClosed() or isClosed()
Line 24: return _transport.closed();
Line 25: }
Line 26:
Line 27: protected <T> Future<VDSMResponse<T>> _call(RequestBuilder rb,
Line 36: public void connectTimeout(long timeout, TimeUnit unit) {
Line 37: _transport.connectTimeout(timeout, unit);
Line 38: }
Line 39:
Line 40: public URI uri() {
getUri()?
Line 41: return _transport.uri();
Line 42: }
Line 43:
Line 44: public String newID() {
Line 40: public URI uri() {
Line 41: return _transport.uri();
Line 42: }
Line 43:
Line 44: public String newID() {
generateId()?
Line 45: return UUID.randomUUID().toString();
Line 46: }
--
To view, visit http://gerrit.ovirt.org/17196
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ida303667cbba365bf14cc10147bbf507e3b730d6
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Barak Azulay <bazulay(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
10 years, 8 months
Change in vdsm[master]: Catching exceptions in daemon adapter
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Catching exceptions in daemon adapter
......................................................................
Catching exceptions in daemon adapter
Change-Id: Ib515b01f06331d744b40236af5a1b12a16c37871
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M init/daemonAdapter
1 file changed, 35 insertions(+), 28 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/10/18810/1
diff --git a/init/daemonAdapter b/init/daemonAdapter
index b0441a6..18612dc 100755
--- a/init/daemonAdapter
+++ b/init/daemonAdapter
@@ -21,6 +21,7 @@
import argparse
import os
import sys
+import syslog
from stat import S_IRUSR, S_IWUSR
from vdsm.config import config
@@ -50,38 +51,44 @@
if __name__ == '__main__':
- args = getArgs()
+ try:
+ args = getArgs()
- os.nice(config.getint('vars', 'vdsm_nice'))
+ os.nice(config.getint('vars', 'vdsm_nice'))
- env = os.environ.copy()
- env.update({
- 'LIBVIRT_LOG_FILTERS': config.get(
- 'vars', 'libvirt_env_variable_log_filters'),
- 'LIBVIRT_LOG_OUTPUTS': config.get(
- 'vars', 'libvirt_env_variable_log_outputs'),
- 'LC_ALL': 'C',
- })
+ env = os.environ.copy()
+ env.update({
+ 'LIBVIRT_LOG_FILTERS': config.get(
+ 'vars', 'libvirt_env_variable_log_filters'),
+ 'LIBVIRT_LOG_OUTPUTS': config.get(
+ 'vars', 'libvirt_env_variable_log_outputs'),
+ 'LC_ALL': 'C',
+ })
- cmd = [args.target[0]] + args.targetOptions
+ cmd = [args.target[0]] + args.targetOptions
- if args.stdin:
- fdin = os.open(args.stdin, os.O_RDONLY)
- os.dup2(fdin, sys.stdin.fileno())
- os.close(fdin)
+ if args.stdin:
+ fdin = os.open(args.stdin, os.O_RDONLY)
+ os.dup2(fdin, sys.stdin.fileno())
+ os.close(fdin)
- # stdout and stderr redirection should be in last minute, otherwise it
- # swallows error messages from daemonAdapter when redirected to /dev/null.
- if args.stdout:
- fdout = os.open(args.stdout, os.O_WRONLY | os.O_CREAT | os.O_APPEND,
- S_IRUSR | S_IWUSR)
- os.dup2(fdout, sys.stdout.fileno())
- os.close(fdout)
+ # stdout and stderr redirection should be in last minute, otherwise it
+ # swallows error messages from daemonAdapter when redirected to
+ # /dev/null.
+ if args.stdout:
+ fdout = os.open(args.stdout, os.O_WRONLY | os.O_CREAT |
+ os.O_APPEND, S_IRUSR | S_IWUSR)
+ os.dup2(fdout, sys.stdout.fileno())
+ os.close(fdout)
- if args.stderr:
- fderr = os.open(args.stderr, os.O_WRONLY | os.O_CREAT | os.O_APPEND,
- S_IRUSR | S_IWUSR)
- os.dup2(fderr, sys.stderr.fileno())
- os.close(fderr)
+ if args.stderr:
+ fderr = os.open(args.stderr, os.O_WRONLY | os.O_CREAT |
+ os.O_APPEND, S_IRUSR | S_IWUSR)
+ os.dup2(fderr, sys.stderr.fileno())
+ os.close(fderr)
- os.execve(cmd[0], cmd, env)
+ os.execve(cmd[0], cmd, env)
+
+ except Exception as e:
+ syslog.syslog("Error in daemonAdapater: %s" % e)
+ sys.exit(1)
--
To view, visit http://gerrit.ovirt.org/18810
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib515b01f06331d744b40236af5a1b12a16c37871
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
10 years, 8 months
Change in vdsm[master]: Changing init script lock flow
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Changing init script lock flow
......................................................................
Changing init script lock flow
Change-Id: Ic74c9cf9c2c520e94a98b99fdb970b544b780ba3
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M init/sysvinit/vdsmd.init.in
1 file changed, 11 insertions(+), 28 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/75/18875/1
diff --git a/init/sysvinit/vdsmd.init.in b/init/sysvinit/vdsmd.init.in
index fb78e6f..dbd78eb 100755
--- a/init/sysvinit/vdsmd.init.in
+++ b/init/sysvinit/vdsmd.init.in
@@ -79,6 +79,7 @@
fi
touch "$LOCK_FILE"
trap cleanup SIGINT SIGHUP SIGTERM
+ "@CHOWN_PATH@" vdsm:kvm "$LOCK_FILE"
}
release_lock() {
@@ -151,23 +152,6 @@
stop() {
echo $"Shutting down vdsm daemon: "
- trap cleanup SIGINT SIGHUP SIGTERM
- if [ -f "$LOCK_FILE" ]; then
- if ! pidofproc -p "$RESPAWNPIDFILE" >/dev/null; then
- log_failure_msg "$prog during another start, cannot stop yet"
- return 1
- else
- kill_instance
- release_lock
- fi
- else
- log_failure_msg "$prog already stopped"
- fi
-
- return 0
-}
-
-kill_instance() {
if killproc -p "$RESPAWNPIDFILE"; then
log_success_msg $"$prog watchdog stop"
fi
@@ -186,28 +170,31 @@
echo "Unexpected signal received, cleaning locks"
if pidofproc -p "$RESPAWNPIDFILE" >/dev/null ||
pidofproc -p "$PIDFILE" >/dev/null; then
- kill_instance
+ stop
fi
release_lock
exit 0
}
-locked_start() {
+locked_operation() {
if ! acquire_lock; then
- log_failure_msg "cannot start VDS daemon when another instance runs"
+ log_failure_msg "cannot perform VDSM daemon operation when another instance runs"
return 1
else
- start || (release_lock && return 1)
+ $1
+ RETVAL=$?
+ release_lock
+ return "${RETVAL}"
fi
}
case "$1" in
start)
- locked_start
+ locked_operation start
RETVAL=$?
;;
stop)
- stop
+ locked_operation stop
RETVAL=$?
;;
status)
@@ -216,11 +203,7 @@
if [ "$RETVAL" -eq 0 ]; then
echo "VDS daemon server is running"
else
- if [ -f "$LOCK_FILE" ]; then
- printf "VDS daemon dead but subsys locked"
- else
- printf "VDS daemon is not running"
- fi
+ echo "VDS daemon is not running"
if pidofproc -p "$RESPAWNPIDFILE" >/dev/null; then
echo ", and its watchdog is running"
else
--
To view, visit http://gerrit.ovirt.org/18875
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic74c9cf9c2c520e94a98b99fdb970b544b780ba3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
10 years, 8 months
Change in vdsm[master]: Fix str/unicode concatenation issue.
by apahim@redhat.com
Amador Pahim has uploaded a new change for review.
Change subject: Fix str/unicode concatenation issue.
......................................................................
Fix str/unicode concatenation issue.
"vdsClient -s 0 getVmsInfo <spUUID>" command fails with error:
Error using command: 'ascii' codec can't encode characters in position
2001-2004: ordinal not in range(128)
Here the snip from guest info xml causing the issue:
...
<app_list>Windows XP ¸üР(KB898461),Microsoft Kernel-Mode Driver Framework
Feature Pack 1.9,RHEV-Tools 3.2.8,WebFldrs XP,RHEV-Serial 3.2.4,RHEV-Spice-Agent
3.2.5,RHEV-Agent 3.2.5,RHEV-SSO 3.2.4,RHEV-USB 3.2.3,RHEV-Balloon 3.2.4,
RHEV-Spice 3.2.3,RHEV-Block 3.2.4,RHEV-Network 3.2.4</app_list>
...
Positions 2001-2004 point for characters "¸üÐÂ".
infos['vmlist'][entry] can be type str or unicode. When it happens to
be unicode with characters out of ASC-II range, converted to str and
concatenated with the given strings, the issue is triggered:
To reproduce with python interpreter:
>>> var = u'¸üÐÂ'
>>> type(var)
<type 'unicode'>
>>> test = 'string' + str(var)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal
not in range(128)
This patch is removing the str() conversion for infos['vmlist'][entry]. The result
is 'messages' variable as type unicode when infos['vmlist'][entry] is unicode.
Also, to avoid stdout redir encode error, the messages print is encoded as UTF-8.
Change-Id: I44dce25bb167da8ade579b2d67eb34a0e05f491b
Signed-off-by: Amador Pahim <apahim(a)redhat.com>
---
M client/vdsClient.py
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/32/19032/1
diff --git a/client/vdsClient.py b/client/vdsClient.py
index eba301a..bb5ed9a 100644
--- a/client/vdsClient.py
+++ b/client/vdsClient.py
@@ -1467,10 +1467,11 @@
message = ''
for entry in infos['vmlist']:
message += '\n' + '================================' + '\n'
- message += entry + '=' + str(infos['vmlist'][entry])
+ message += entry + '=' + infos['vmlist'][entry]
if not message:
message = 'No VMs found.'
- print message
+ print message.encode("utf-8")
+
return 0, ''
def do_getVmsList(self, args):
--
To view, visit http://gerrit.ovirt.org/19032
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I44dce25bb167da8ade579b2d67eb34a0e05f491b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Amador Pahim <apahim(a)redhat.com>
10 years, 8 months
Change in vdsm[master]: Avoid race condition with vdsm-reg during firstboot
by fgranha@linux.vnet.ibm.com
Fernando Granha Jeronimo has uploaded a new change for review.
Change subject: Avoid race condition with vdsm-reg during firstboot
......................................................................
Avoid race condition with vdsm-reg during firstboot
In the vdsm-config script, the vdsm-reg service is disabled to
avoid race conditions, once it is intended to be executed just
before the node is rebooted and the registration process should
take place only after reboot.
Change-Id: I2a215bbe6c467d10cf414b09cdaee5340092198e
Signed-off-by: Fernando Granha Jeronimo <fgranha(a)linux.vnet.ibm.com>
---
M vdsm_reg/vdsm-config
1 file changed, 10 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/8200/1
diff --git a/vdsm_reg/vdsm-config b/vdsm_reg/vdsm-config
index 968d78c..0a030d1 100755
--- a/vdsm_reg/vdsm-config
+++ b/vdsm_reg/vdsm-config
@@ -14,6 +14,16 @@
echo "vdsm-config: starting" | tee $LOG
+ # Disable vdsm-reg service to avoid race condition
+ # when parameters are written to config file and the
+ # service is running. This is necessary, because the
+ # registration process can take place only after reboot.
+ if [ -x /bin/systemctl ] ; then
+ /bin/systemctl stop vdsm-reg.service > /dev/null 2>&1
+ elif [ -x /sbin/service ] ; then
+ /sbin/service vdsm-reg stop > /dev/null 2>&1
+ fi
+
set_vars() {
echo "[vars]" >> $VDSM_CONFIG #Adding ts for the coming scripts.
echo "trust_store_path = " `$GETCONFITEM $VDSM_CONFIG vars trust_store_path /etc/pki/vdsm` >> $VDSM_CONFIG
--
To view, visit http://gerrit.ovirt.org/8200
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a215bbe6c467d10cf414b09cdaee5340092198e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Fernando Granha Jeronimo <fgranha(a)linux.vnet.ibm.com>
10 years, 8 months
Change in vdsm[master]: [WIP]change startup process for vdsm and supervdsm
by lvroyce@linux.vnet.ibm.com
Royce Lv has uploaded a new change for review.
Change subject: [WIP]change startup process for vdsm and supervdsm
......................................................................
[WIP]change startup process for vdsm and supervdsm
Using vdsmService to take care of start up and respawn process of
vdsm and supervdsm. Remove the function of vdsm to start previlege
supervdsm process.
Change-Id: I69aae6b0b9529c80291d90c6ad14ff82b21aea53
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
M vdsm.spec.in
M vdsm/Makefile.am
M vdsm/storage/misc.py
M vdsm/supervdsm.py
M vdsm/supervdsmServer.py
M vdsm/vdsm
A vdsm/vdsmService
M vdsm/vdsmd.init.in
M vdsm_reg/Makefile.am
9 files changed, 208 insertions(+), 63 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/45/4145/1
--
To view, visit http://gerrit.ovirt.org/4145
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I69aae6b0b9529c80291d90c6ad14ff82b21aea53
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
10 years, 8 months
Change in vdsm[master]: Modify vdsm/netinfo.py for PEP8 compliance
by qiaoliyong@gmail.com
Eli Qiao has uploaded a new change for review.
Change subject: Modify vdsm/netinfo.py for PEP8 compliance
......................................................................
Modify vdsm/netinfo.py for PEP8 compliance
Change-Id: I5a8370da88235ff0edce7cf7b1a350fb0402e7d9
Signed-off-by: Eli Qiao <qiaoliyong(a)gmail.com>
---
M vdsm/netinfo.py
1 file changed, 62 insertions(+), 28 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/34/4334/1
--
To view, visit http://gerrit.ovirt.org/4334
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a8370da88235ff0edce7cf7b1a350fb0402e7d9
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eli Qiao <qiaoliyong(a)gmail.com>
10 years, 8 months