Change in vdsm[master]: network: allow custom bondOption
by phoracek@redhat.com
Petr Horáček has uploaded a new change for review.
Change subject: network: allow custom bondOption
......................................................................
network: allow custom bondOption
Allow 'custom' in bond options. This value will be accepted by
Bond.validateOptions method but it will not be passed to configurator.
Thanks to this patch, users will be allowed to pass custom properties
to setupNetworks hooks.
This path was reverted in past because of malfunction, now it should
work, there is a new test for sure.
Change-Id: I9ace532d959bc3195a8a92b4536bdc0062bc7d1d
Signed-off-by: Petr Horáček <phoracek(a)redhat.com>
---
M lib/vdsm/netinfo.py
M tests/functional/networkTests.py
M vdsm/network/models.py
3 files changed, 44 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/82/40882/1
diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py
index e7563d6..3a2aa8e 100644
--- a/lib/vdsm/netinfo.py
+++ b/lib/vdsm/netinfo.py
@@ -70,8 +70,9 @@
_BONDING_FAILOVER_MODES = frozenset(('1', '3'))
_BONDING_LOADBALANCE_MODES = frozenset(('0', '2', '4', '5', '6'))
_EXCLUDED_BONDING_ENTRIES = frozenset((
- 'slaves', 'active_slave', 'mii_status', 'queue_id', 'ad_aggregator',
- 'ad_num_ports', 'ad_actor_key', 'ad_partner_key', 'ad_partner_mac'
+ 'slaves', 'active_slave', 'mii_status', 'queue_id', 'ad_aggregator',
+ 'ad_num_ports', 'ad_actor_key', 'ad_partner_key', 'ad_partner_mac',
+ 'custom'
))
_IFCFG_ZERO_SUFFIXED = frozenset(
('IPADDR0', 'GATEWAY0', 'PREFIX0', 'NETMASK0'))
diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py
index 0bfda68..1328783 100644
--- a/tests/functional/networkTests.py
+++ b/tests/functional/networkTests.py
@@ -1848,7 +1848,7 @@
else:
network_params.update(
{'ipaddr': IP_ADDRESS_IN_NETWORK, 'netmask': IP_MASK,
- 'gateway': IP_GATEWAY})
+ 'gateway': IP_GATEWAY})
status, msg = self.vdsm_net.setupNetworks(
{NETWORK_NAME: network_params}, {}, NOCHK)
@@ -2387,3 +2387,25 @@
self.assertNetworkDoesntExist(NETWORK_NAME)
self.assertBondDoesntExist(BONDING_NAME, [nic])
self.vdsm_net.save_config()
+
+ @cleanupNet
+ @ValidateRunningAsRoot
+ def test_setupNetworks_bond_with_custom_option(self):
+ with dummyIf(1) as nics:
+ status, msg = self.vdsm_net.setupNetworks(
+ {},
+ {BONDING_NAME: {'nics': nics,
+ 'options': 'custom=foo mode=balance-rr'}},
+ NOCHK)
+ self.assertEqual(status, SUCCESS, msg)
+ self.assertBondExists(BONDING_NAME, nics)
+ with open(NET_CONF_PREF + BONDING_NAME) as f:
+ for l in f:
+ if 'BONDING_OPTS' in l:
+ self.assertNotIn('custom=foo', l)
+ self.assertIn('mode=balance-rr', l)
+
+ status, msg = self.vdsm_net.setupNetworks(
+ {}, {BONDING_NAME: {'remove': True}}, NOCHK)
+ self.assertEqual(status, SUCCESS, msg)
+ self.assertBondDoesntExist(BONDING_NAME, nics)
diff --git a/vdsm/network/models.py b/vdsm/network/models.py
index 708bad8..9526b99 100644
--- a/vdsm/network/models.py
+++ b/vdsm/network/models.py
@@ -276,9 +276,25 @@
_netinfo=_netinfo))
return slaves
+ @staticmethod
+ def remove_custom_option(options):
+ """ 'custom' property should not be exposed to configurator, it is
+ only for purpose of hooks """
+ d_opts = dict(opt.split('=', 1) for opt in options.split())
+ try:
+ d_opts.pop('custom')
+ d_opts = ['%s=%s' % (key, value) for key, value in d_opts.items()]
+ return ' '.join(d_opts)
+ except KeyError:
+ return options
+
@classmethod
def objectivize(cls, name, configurator, options, nics, mtu, _netinfo,
destroyOnMasterRemoval=None):
+
+ if options:
+ options = cls.remove_custom_option(options)
+
if nics: # New bonding or edit bonding.
slaves = cls._objectivizeSlaves(name, configurator, _nicSort(nics),
mtu, _netinfo)
@@ -318,8 +334,8 @@
try:
for option in bondingOptions.split():
key, _ = option.split('=')
- if not os.path.exists('/sys/class/net/%s/bonding/%s' %
- (bond, key)):
+ if key != 'custom' and not os.path.exists(
+ '/sys/class/net/%s/bonding/%s' % (bond, key)):
raise ConfigNetworkError(ne.ERR_BAD_BONDING, '%r is '
'not a valid bonding option' %
key)
--
To view, visit https://gerrit.ovirt.org/40882
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9ace532d959bc3195a8a92b4536bdc0062bc7d1d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek(a)redhat.com>
7 years, 11 months
Change in vdsm[master]: virt: don't log password in update graphic device
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: virt: don't log password in update graphic device
......................................................................
virt: don't log password in update graphic device
updateDevice invoked against a graphics device
allows Engine (or any other caller) to change the
SPICE ticket.
This patch make sure the ticket is not logged.
Change-Id: I4c3d318a16eb4d1b10a12f650ba957057e090532
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/rpc/BindingXMLRPC.py
1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/73/41073/1
diff --git a/vdsm/rpc/BindingXMLRPC.py b/vdsm/rpc/BindingXMLRPC.py
index fbce42d..80136c1 100644
--- a/vdsm/rpc/BindingXMLRPC.py
+++ b/vdsm/rpc/BindingXMLRPC.py
@@ -1159,6 +1159,12 @@
elif f.__name__ == 'convertExternalVm':
if len(args) > 3:
displayArgs = args[:2] + ('****',) + args[3:]
+ elif f.__name__ == 'vmUpdateDevice':
+ if len(args) == 2 and args[1].get(
+ 'deviceType', '') == 'graphics':
+ devParams = args[1].copy()
+ devParams['password'] = '****'
+ displayArgs = args[0] + [devParams]
# Logging current call
logStr = 'client [%s]::call %s with %s %s' % \
--
To view, visit https://gerrit.ovirt.org/41073
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4c3d318a16eb4d1b10a12f650ba957057e090532
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
7 years, 11 months
Change in vdsm[master]: net: run dhclient in its own process group.
by ibarkan@redhat.com
Ido Barkan has uploaded a new change for review.
Change subject: net: run dhclient in its own process group.
......................................................................
net: run dhclient in its own process group.
This is done to prevent systemd from killing supervdsm dhclient child
processes during supervdsm stop (or restart). Forking dhclient in
its own process group prevents systemd from doing this.
Since dhclient is deliberately killed either directly by supervdsm or
indirectly by executing ifdown on a device and since executing a
process in a different process group is harmless, the separate
cgroup is now the default behaviour.
This patch also fixes https://bugzilla.redhat.com/show_bug
.cgi?id=1187244 in a less clumsy way than KillMode=process.
Change-Id: I82848a36b52cd8e9dec188d865ef86edc4bb7488
Signed-off-by: Ido Barkan <ibarkan(a)redhat.com>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1228322
---
M init/systemd/vdsm-network.service.in
M vdsm/network/configurators/dhclient.py
M vdsm/network/configurators/ifcfg.py
3 files changed, 20 insertions(+), 10 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/05/43005/1
diff --git a/init/systemd/vdsm-network.service.in b/init/systemd/vdsm-network.service.in
index 722a2b4..3c992f3 100644
--- a/init/systemd/vdsm-network.service.in
+++ b/init/systemd/vdsm-network.service.in
@@ -9,7 +9,6 @@
EnvironmentFile=-/etc/sysconfig/vdsm
ExecStartPre=@BINDIR@/vdsm-tool --vvverbose --append --logfile=@VDSMLOGDIR(a)/upgrade.log upgrade-unified-persistence
ExecStart=@BINDIR@/vdsm-tool restore-nets
-KillMode=process
RemainAfterExit=yes
[Install]
diff --git a/vdsm/network/configurators/dhclient.py b/vdsm/network/configurators/dhclient.py
index 67f7eba..d71b5ff 100644
--- a/vdsm/network/configurators/dhclient.py
+++ b/vdsm/network/configurators/dhclient.py
@@ -25,12 +25,15 @@
import signal
import threading
+from vdsm import cmdutils
from vdsm import ipwrapper
from vdsm import netinfo
from vdsm.utils import CommandPath
from vdsm.utils import execCmd
from vdsm.utils import pgrep
from vdsm.utils import rmFile
+
+DHCLIENT_CGROUP = 'vdsm-dhclient'
class DhcpClient(object):
@@ -39,7 +42,7 @@
LEASE_FILE = os.path.join(LEASE_DIR, 'dhclient{0}--{1}.lease')
DHCLIENT = CommandPath('dhclient', '/sbin/dhclient')
- def __init__(self, iface, family=4):
+ def __init__(self, iface, family=4, cgroup=DHCLIENT_CGROUP):
self.iface = iface
self.family = family
self.pidFile = self.PID_FILE % (family, self.iface)
@@ -47,14 +50,16 @@
os.mkdir(self.LEASE_DIR)
self.leaseFile = self.LEASE_FILE.format(
'' if family == 4 else '6', self.iface)
+ self._cgroup = cgroup
def _dhclient(self):
# Ask dhclient to stop any dhclient running for the device
if os.path.exists(os.path.join(netinfo.NET_PATH, self.iface)):
kill_dhclient(self.iface, self.family)
- rc, out, err = execCmd([self.DHCLIENT.cmd, '-%s' % self.family,
- '-1', '-pf', self.pidFile,
- '-lf', self.leaseFile, self.iface])
+ cmd = [self.DHCLIENT.cmd, '-%s' % self.family, '-1', '-pf',
+ self.pidFile, '-lf', self.leaseFile, self.iface]
+ cmd = cmdutils.systemd_run(cmd, scope=True, slice=self._cgroup)
+ rc, out, err = execCmd(cmd)
return rc, out, err
def start(self, blocking):
diff --git a/vdsm/network/configurators/ifcfg.py b/vdsm/network/configurators/ifcfg.py
index e76be51..450a6d1 100644
--- a/vdsm/network/configurators/ifcfg.py
+++ b/vdsm/network/configurators/ifcfg.py
@@ -33,6 +33,7 @@
from libvirt import libvirtError, VIR_ERR_NO_NETWORK
from vdsm.config import config
+from vdsm import cmdutils
from vdsm import constants
from vdsm import ipwrapper
from vdsm import netinfo
@@ -740,9 +741,14 @@
return rc
-def _exec_ifup(iface_name):
+def _exec_ifup(iface_name, cgroup=dhclient.DHCLIENT_CGROUP):
"""Bring up an interface"""
- rc, out, err = utils.execCmd([constants.EXT_IFUP, iface_name], raw=False)
+ cmd = [constants.EXT_IFUP, iface_name]
+
+ if cgroup is not None:
+ cmd = cmdutils.systemd_run(cmd, scope=True, slice=cgroup)
+
+ rc, out, err = utils.execCmd(cmd, raw=False)
if rc != 0:
# In /etc/sysconfig/network-scripts/ifup* the last line usually
@@ -750,16 +756,16 @@
raise ConfigNetworkError(ERR_FAILED_IFUP, out[-1] if out else '')
-def _ifup(iface):
+def _ifup(iface, cgroup=dhclient.DHCLIENT_CGROUP):
if not iface.blockingdhcp and (iface.ipv4.bootproto == 'dhcp' or
iface.ipv6.dhcpv6):
# wait for dhcp in another thread, so vdsm won't get stuck (BZ#498940)
t = threading.Thread(target=_exec_ifup, name='ifup-waiting-on-dhcp',
- args=(iface.name,))
+ args=(iface.name, cgroup))
t.daemon = True
t.start()
else:
- _exec_ifup(iface.name)
+ _exec_ifup(iface.name, cgroup)
def _restore_default_bond_options(bond_name, desired_options):
--
To view, visit https://gerrit.ovirt.org/43005
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I82848a36b52cd8e9dec188d865ef86edc4bb7488
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan(a)redhat.com>
7 years, 11 months
Change in vdsm[master]: snapshot: Add VM.freeze() and VM.thaw() apis.
by michal.skrivanek@redhat.com
Michal Skrivanek has posted comments on this change.
Change subject: snapshot: Add VM.freeze() and VM.thaw() apis.
......................................................................
Patch Set 4: Code-Review-1
(1 comment)
https://gerrit.ovirt.org/#/c/43058/4/vdsm/virt/vm.py
File vdsm/virt/vm.py:
Line 2872: conf.update(driveParams)
Line 2873: self.saveState()
Line 2874:
Line 2875: def freeze(self):
Line 2876: guest = snapshot.GuestAgent(self._dom, self.log)
as noted in the other patch - you can easily do it right here (we don't really need yet another wrapper just to pass arguments further. We already have API.py)
or delegate to the current guest agent class (which is a different agent, but it does handle connection/socket to qemu-ga, so why not...)
Or alternatively implement that functionality in "our" guest agent which would delegate to qemu-ga internally. Advantage is that unlike libvirt we are a bit better in handling non responding cases
Line 2877: return guest.freeze_filesystems()
Line 2878:
Line 2879: def thaw(self):
Line 2880: guest = snapshot.GuestAgent(self._dom, self.log)
--
To view, visit https://gerrit.ovirt.org/43058
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I44c4237841e44548f48f626f4241d3f2e484930e
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Daniel Erez <derez(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Maor Lipchuk <mlipchuk(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes
7 years, 11 months
Change in vdsm[master]: load_needed_modules verb is not required
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: load_needed_modules verb is not required
......................................................................
load_needed_modules verb is not required
Since ovirt-3.6 systemd takes care for loading required kernel modules during
installation by using vdsm-modules-load.d.conf
Change-Id: I44e4624c354401116040b3fd5bbb54b6f31ee727
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M .gitignore
M debian/vdsm-python.install
M init/vdsmd_init_common.sh.in
M lib/vdsm/tool/Makefile.am
D lib/vdsm/tool/load_needed_modules.py.in
M vdsm-tool/vdsm-tool.1.in
M vdsm.spec.in
7 files changed, 0 insertions(+), 87 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/40/43040/1
diff --git a/.gitignore b/.gitignore
index 3fef689..0f5305f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,7 +36,6 @@
init/vdsmd_init_common.sh
lib/vdsm/config.py
lib/vdsm/constants.py
-lib/vdsm/tool/load_needed_modules.py
lib/vdsm/tool/validate_ovirt_certs.py
lib/vdsm/vdscli.py
lib/vdsm/vdsm.conf.sample
diff --git a/debian/vdsm-python.install b/debian/vdsm-python.install
index 57d5033..d9402c3 100644
--- a/debian/vdsm-python.install
+++ b/debian/vdsm-python.install
@@ -35,7 +35,6 @@
./usr/lib/python2.7/dist-packages/vdsm/tool/dump_bonding_defaults.py
./usr/lib/python2.7/dist-packages/vdsm/tool/dump_volume_chains.py
./usr/lib/python2.7/dist-packages/vdsm/tool/configurator.py
-./usr/lib/python2.7/dist-packages/vdsm/tool/load_needed_modules.py
./usr/lib/python2.7/dist-packages/vdsm/tool/nwfilter.py
./usr/lib/python2.7/dist-packages/vdsm/tool/passwd.py
./usr/lib/python2.7/dist-packages/vdsm/tool/register.py
diff --git a/init/vdsmd_init_common.sh.in b/init/vdsmd_init_common.sh.in
index 43d0db5..47372fd 100644
--- a/init/vdsmd_init_common.sh.in
+++ b/init/vdsmd_init_common.sh.in
@@ -153,13 +153,6 @@
}
-task_load_needed_modules(){
- if ! _has_systemd; then
- "${VDSM_TOOL}" load-needed-modules
- fi
-}
-
-
task_dump_bonding_defaults(){
"${VDSM_TOOL}" dump-bonding-defaults
}
@@ -301,9 +294,6 @@
case "$1" in
--pre-start)
- # If dump_bonding_defaults is desired (for the uneliminable possibility
- # of added bonding options or tweaked kernel defaults) it has to be run
- # after load_needed_modules (modprobe bonding).
# NetworkManager must not crash on nmcli conn delete.
run_tasks " \
mkdirs \
@@ -318,7 +308,6 @@
syslog_available \
nwfilter \
dummybr \
- load_needed_modules \
tune_system \
test_space \
test_lo \
diff --git a/lib/vdsm/tool/Makefile.am b/lib/vdsm/tool/Makefile.am
index d93156e..c8979ca 100644
--- a/lib/vdsm/tool/Makefile.am
+++ b/lib/vdsm/tool/Makefile.am
@@ -22,12 +22,10 @@
include $(top_srcdir)/build-aux/Makefile.subs
EXTRA_DIST = \
- load_needed_modules.py.in \
validate_ovirt_certs.py.in \
$(NULL)
nodist_vdsmtool_PYTHON = \
- load_needed_modules.py \
validate_ovirt_certs.py \
$(NULL)
diff --git a/lib/vdsm/tool/load_needed_modules.py.in b/lib/vdsm/tool/load_needed_modules.py.in
deleted file mode 100644
index dc7d533..0000000
--- a/lib/vdsm/tool/load_needed_modules.py.in
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright IBM, Corp. 2012
-# Copyright 2013-2014 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Refer to the README and COPYING files for full details of the license
-#
-
-
-from __future__ import absolute_import
-import os.path
-
-from . import expose, ExtraArgsError
-from ..utils import execCmd
-
-
-EX_MODPROBE = '@MODPROBE_PATH@'
-
-
-def _exec_command(argv):
- """
- This function executes a given shell command.
- """
- rc, out, err = execCmd(argv, raw=True)
- if rc != 0:
- raise RuntimeError(
- "Execute command %s failed: %s" % (argv, err)
- )
-
-
-def _enable_softdog():
- if not os.path.exists('/dev/watchdog'):
- _exec_command([EX_MODPROBE, 'softdog'])
-
-
-@expose('load-needed-modules')
-def load_needed_modules(*args):
- """
- load-needed-modules
- Load needed modules
- """
-
- if len(args) > 1:
- raise ExtraArgsError()
-
- for mod in ['bridge', 'tun', 'bonding', '8021q']:
- _exec_command([EX_MODPROBE, mod])
- _enable_softdog()
diff --git a/vdsm-tool/vdsm-tool.1.in b/vdsm-tool/vdsm-tool.1.in
index d29dc1e..571abc8 100644
--- a/vdsm-tool/vdsm-tool.1.in
+++ b/vdsm-tool/vdsm-tool.1.in
@@ -72,13 +72,6 @@
Defines a dummy bridge on a libvirt network.
.RE
.TP
-Options for the \fIload_needed_modules\fP module:
-.RS
-.TP
-.B load-needed-modules
-Loads the required modules.
-.RE
-.TP
Options for the \fInwfilter\fP module:
.RS
.TP
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 2f5ffc8..e6bf872 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -1189,11 +1189,6 @@
%{_datadir}/%{vdsm_name}/config.py*
%{_datadir}/%{vdsm_name}/netinfo.py*
%endif
-%if 0%{?with_systemd}
-%exclude %{python_sitelib}/%{vdsm_name}/tool/load_needed_modules.py*
-%else
-%{python_sitelib}/%{vdsm_name}/tool/load_needed_modules.py*
-%endif
%{python_sitelib}/%{vdsm_name}/tool/configfile.py*
%{python_sitelib}/%{vdsm_name}/tool/dummybr.py*
%{python_sitelib}/%{vdsm_name}/tool/dump_bonding_defaults.py*
--
To view, visit https://gerrit.ovirt.org/43040
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I44e4624c354401116040b3fd5bbb54b6f31ee727
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
7 years, 11 months
Change in vdsm[master]: jsonrpc: vdscli: migration: fix migrationCreate
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: jsonrpc: vdscli: migration: fix migrationCreate
......................................................................
jsonrpc: vdscli: migration: fix migrationCreate
In virt migration code, we do logic on the return
value of VM.migrationCreate API, and we expect it
to be a proper response, so with ['status']['code']
field, plus all the extra fields that APIs can add
(see schema for examples).
Current jsonrpc code strips all but the extra fields,
so jsonrpcvdscli has to force fit a success code.
This patch simplify the code by just passing around
a copy of the raw data, leveraging the response module.
This way the code is both simpler and more conformant
to the old XML-RPC vdscli API.
Change-Id: Ie9288d367c519830f6510a2d1b2a5fc1e410949c
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M lib/vdsm/jsonrpcvdscli.py
1 file changed, 6 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/70/42970/1
diff --git a/lib/vdsm/jsonrpcvdscli.py b/lib/vdsm/jsonrpcvdscli.py
index 595c584..8ef1cbf 100644
--- a/lib/vdsm/jsonrpcvdscli.py
+++ b/lib/vdsm/jsonrpcvdscli.py
@@ -26,6 +26,8 @@
JsonRpcRequest, \
JsonRpcNoResponseError
+from vdsm import response
+
_COMMAND_CONVERTER = {
'ping': 'Host.ping',
@@ -58,13 +60,12 @@
if resp.error is not None:
return resp.error
- return resp.result
+ return response.success(**resp.result)
def migrationCreate(self, params):
- self._callMethod('migrationCreate',
- params['vmId'],
- params)
- return {'status': {'code': 0}}
+ return self._callMethod('migrationCreate',
+ params['vmId'],
+ params)
def __getattr__(self, methodName):
return partial(self._callMethod, methodName)
--
To view, visit https://gerrit.ovirt.org/42970
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie9288d367c519830f6510a2d1b2a5fc1e410949c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
7 years, 11 months
Change in vdsm[master]: snapshot: Add VM.freeze() and VM.thaw() apis.
by fromani@redhat.com
Francesco Romani has posted comments on this change.
Change subject: snapshot: Add VM.freeze() and VM.thaw() apis.
......................................................................
Patch Set 4: Code-Review+1
once 43018 is ready, this is straightforward. Conditional ACK :)
--
To view, visit https://gerrit.ovirt.org/43058
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I44c4237841e44548f48f626f4241d3f2e484930e
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Daniel Erez <derez(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Maor Lipchuk <mlipchuk(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
7 years, 11 months
Change in vdsm[master]: snapshot: Add VM.freeze() and VM.thaw() apis.
by Nir Soffer
Nir Soffer has posted comments on this change.
Change subject: snapshot: Add VM.freeze() and VM.thaw() apis.
......................................................................
Patch Set 4:
This version updates the apis to remove the mountpoints parameter.
--
To view, visit https://gerrit.ovirt.org/43058
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I44c4237841e44548f48f626f4241d3f2e484930e
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Daniel Erez <derez(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Maor Lipchuk <mlipchuk(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
7 years, 11 months
Change in vdsm[master]: snapshot: Add VM.freeze() and VM.thaw() apis.
by Nir Soffer
Nir Soffer has posted comments on this change.
Change subject: snapshot: Add VM.freeze() and VM.thaw() apis.
......................................................................
Patch Set 4: Verified+1
--
To view, visit https://gerrit.ovirt.org/43058
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I44c4237841e44548f48f626f4241d3f2e484930e
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Daniel Erez <derez(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Maor Lipchuk <mlipchuk(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
7 years, 11 months
Change in vdsm[master]: snapshot: Add VM.freeze() and VM.thaw() apis.
by automation@ovirt.org
automation(a)ovirt.org has posted comments on this change.
Change subject: snapshot: Add VM.freeze() and VM.thaw() apis.
......................................................................
Patch Set 4:
* Update tracker::IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
--
To view, visit https://gerrit.ovirt.org/43058
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I44c4237841e44548f48f626f4241d3f2e484930e
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Daniel Erez <derez(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Maor Lipchuk <mlipchuk(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
7 years, 11 months