Francesco Romani has uploaded a new change for review.
Change subject: network: devices: properly initialize attributes
......................................................................
network: devices: properly initialize attributes
The `name' attribute used to be added to devices only after the
device data was refreshed from libvirt.
This can lead to AttributeErrors if a VM starts (very) slowly.
Furthermore, is good practice to initialize all the device
object attributes in __init__.
Change-Id: I21ef87a9524cbfe752e6cc0f7d1d9f6139c61dfb
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/vmdevices/network.py
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/72/65772/1
diff --git a/vdsm/virt/vmdevices/network.py b/vdsm/virt/vmdevices/network.py
index 7628f06..618c34d 100644
--- a/vdsm/virt/vmdevices/network.py
+++ b/vdsm/virt/vmdevices/network.py
@@ -48,6 +48,7 @@
kwargs[attr] = net_api.DUMMY_BRIDGE
super(Interface, self).__init__(conf, log, **kwargs)
self.sndbufParam = False
+ self.name = ""
self.is_hostdevice = self.device == hwclass.HOSTDEV
self.vlanId = self.specParams.get('vlanid')
self._customize()
--
To view, visit https://gerrit.ovirt.org/65772
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I21ef87a9524cbfe752e6cc0f7d1d9f6139c61dfb
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has posted comments on this change.
Change subject: vm_migrate_hook: skip interface handling for customized VMs
......................................................................
Patch Set 2: Code-Review-1
--
To view, visit https://gerrit.ovirt.org/67455
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Icd52d076ceb563ce965bdd90d850868bb6580e3d
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Marcin Mirecki <mmirecki(a)redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has posted comments on this change.
Change subject: vm_migrate_hook: skip interface handling for customized VMs
......................................................................
Patch Set 2:
Please limit this to the approved list of custom properties.
We agreed to accept openstack, vmfex, macspoof
--
To view, visit https://gerrit.ovirt.org/67455
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Icd52d076ceb563ce965bdd90d850868bb6580e3d
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Marcin Mirecki <mmirecki(a)redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has submitted this change and it was merged.
Change subject: python: change python scripts to python2
......................................................................
python: change python scripts to python2
starting from fc25, python3 will be default, and
/usr/bin/python path will point to python3.
All interpreter paths in python scripts were changed
to python2.
This is a quick fix in order to ensure the scripts will
continue to run without errors.
All scripts should be py3 compatible in the future.
Signed-off-by: Irit Goihman <igoihman(a)redhat.com>
Change-Id: Ie8eaefe5f7e0831c362546733a2fa9301b7f9ad6
---
M build-aux/vercmp
M contrib/refmt
M contrib/repoplot
M contrib/runvm
M init/daemonAdapter
M init/wait_for_ipv4s
M lib/vdsm/tool/dummybr.py
M lib/vdsm/tool/nwfilter.py
M tests/alignmentScanTests.py
M tests/hooksTests.py
M tests/tests_child.py
M vdsm-tool/vdsm-tool
M vdsm/get-conf-item
M vdsm/set-conf-item
M vdsm/storage/curl-img-wrap
M vdsm/storage/fc-scan
M vdsm/supervdsmServer
M vdsm/vdsm
M vdsm/vdsm-restore-net-config
M vdsm_hooks/checkimages/before_vm_start.py
M vdsm_hooks/checkips/checkips_utils.py
M vdsm_hooks/checkips/checkipsd
M vdsm_hooks/extnet/extnet_vnic.py
M vdsm_hooks/fakesriov/after_get_caps.py
M vdsm_hooks/fakesriov/after_hostdev_list_by_caps.py
M vdsm_hooks/fakevmstats/after_get_all_vm_stats.py
M vdsm_hooks/faqemu/after_get_caps.py
M vdsm_hooks/faqemu/before_vm_start.py
M vdsm_hooks/floppy/before_vm_migrate_source.py
M vdsm_hooks/floppy/before_vm_start.py
M vdsm_hooks/hostusb/after_vm_destroy.py
M vdsm_hooks/hostusb/before_vm_migrate_source.py
M vdsm_hooks/hostusb/before_vm_start.py
M vdsm_hooks/httpsisoboot/before_vm_start.py
M vdsm_hooks/hugepages/after_vm_destroy.py
M vdsm_hooks/hugepages/before_vm_migrate_destination.py
M vdsm_hooks/hugepages/before_vm_start.py
M vdsm_hooks/ipv6/ipv6.py
M vdsm_hooks/isolatedprivatevlan/before_vm_start.py
M vdsm_hooks/macspoof/before_vm_start.py
M vdsm_hooks/nestedvt/before_vm_start.py
M vdsm_hooks/numa/before_vm_start.py
M vdsm_hooks/openstacknet/after_device_create.py
M vdsm_hooks/openstacknet/after_device_destroy.py
M vdsm_hooks/openstacknet/after_vm_start.py
M vdsm_hooks/openstacknet/before_device_create.py
M vdsm_hooks/openstacknet/before_device_migrate_destination.py
M vdsm_hooks/openstacknet/openstacknet_utils.py
M vdsm_hooks/ovs/ovs_after_get_caps.py
M vdsm_hooks/ovs/ovs_after_get_stats.py
M vdsm_hooks/ovs/ovs_after_network_setup.py
M vdsm_hooks/ovs/ovs_after_network_setup_fail.py
M vdsm_hooks/ovs/ovs_before_device_create.py
M vdsm_hooks/ovs/ovs_before_network_setup.py
M vdsm_hooks/pincpu/before_vm_start.py
M vdsm_hooks/promisc/after_vm_start.py
M vdsm_hooks/promisc/before_vm_destroy.py
M vdsm_hooks/qemucmdline/before_vm_start.py
M vdsm_hooks/qos/before_vm_start.py
M vdsm_hooks/scratchpad/after_vm_destroy.py
M vdsm_hooks/scratchpad/before_vm_migrate_source.py
M vdsm_hooks/scratchpad/before_vm_start.py
M vdsm_hooks/smbios/before_vm_start.py
M vdsm_hooks/spiceoptions/before_vm_start.py
M vdsm_hooks/vhostmd/after_vm_destroy.py
M vdsm_hooks/vhostmd/before_vm_start.py
M vdsm_hooks/vmdisk/before_vm_start.py
M vdsm_hooks/vmfex/before_vm_migrate_destination.py
M vdsm_hooks/vmfex/before_vm_start.py
M vdsm_hooks/vmfex_dev/vmfex_vnic.py
70 files changed, 70 insertions(+), 70 deletions(-)
Approvals:
Yaniv Bronhaim: Looks good to me, but someone else must approve
Jenkins CI: Passed CI tests
Irit Goihman: Verified
Dan Kenigsberg: Looks good to me, approved
--
To view, visit https://gerrit.ovirt.org/67502
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie8eaefe5f7e0831c362546733a2fa9301b7f9ad6
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Irit Goihman <igoihman(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Irit Goihman <igoihman(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Nir Soffer has uploaded a new change for review.
Change subject: contrib: Simple jsonrpc client
......................................................................
contrib: Simple jsonrpc client
This is a simple jsonrpc client for communicating with the jsonrpc
server from the command line.
Arguments
method one of the mehtods described in json schema
params optionl json object with message parameters
Examples
Calling method without arguements:
# jsonrpc Host.getVMList
{
"jsonrpc": "2.0",
"id": "0e043d83-294a-4d31-b1b6-6dc2f2747494",
"result": [
"b3f6fa00-b315-4ad4-8108-f73da817b5c5"
]
}
Calling method with arguements:
# jsonrpc VM.getStats '{"vmID": "b3f6fa00-b315-4ad4-8108-f73da817b5c5"}'
{
"jsonrpc": "2.0",
"id": "cefd25a3-6250-4123-8a56-d7047899e19e",
"result": [
{
"status": "Down",
"exitMessage": "Admin shut down from the engine",
"vmId": "b3f6fa00-b315-4ad4-8108-f73da817b5c5",
"exitReason": 6,
"timeOffset": "0",
"exitCode": 0
}
]
}
Requires stomp.py library:
https://pypi.python.org/pypi/stomp.py
Change-Id: Ia6273eabf6f3601602659d1e4e748d8025ae8084
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
A contrib/jsonrpc
1 file changed, 104 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/81/35181/1
diff --git a/contrib/jsonrpc b/contrib/jsonrpc
new file mode 100755
index 0000000..3080193
--- /dev/null
+++ b/contrib/jsonrpc
@@ -0,0 +1,104 @@
+#!/usr/bin/python
+#
+# Copyright 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
+#
+"""
+jsonrpc-cli - Vdsm jsonrpc client
+"""
+
+import json
+import os
+import signal
+import sys
+import time
+import uuid
+import optparse
+
+import stomp
+
+# Copied from lib/vdsm/vdscli.py
+PKIDIR = '/etc/pki/vdsm'
+KEYFILE = os.path.join(PKIDIR, 'keys/vdsmkey.pem')
+CERTFILE = os.path.join(PKIDIR, 'certs/vdsmcert.pem')
+CACERT = os.path.join(PKIDIR, 'certs/cacert.pem')
+
+PORT = 54321
+DESTINATION = "/queue/_local/vdsm/requests"
+
+
+class Listener(stomp.ConnectionListener):
+
+ def on_error(self, headers, message):
+ print 'Error: %s' % message
+ terminate()
+
+ def on_message(self, headers, message):
+ msg = json.loads(message)
+ print json.dumps(msg, indent=4)
+ terminate()
+
+
+def main(args):
+ parser = option_parser()
+ options, args = parser.parse_args(args)
+ if not args:
+ parser.error("method required")
+
+ msg = {
+ "id": str(uuid.uuid4()),
+ "jsonrpc": "2.0",
+ "method": args[0]
+ }
+
+ if len(args) > 1:
+ msg["params"] = json.loads(args[1])
+
+ conn = stomp.Connection10(
+ host_and_ports=((options.host, PORT),),
+ use_ssl=True,
+ ssl_key_file=KEYFILE,
+ ssl_cert_file=CERTFILE,
+ ssl_ca_certs=CACERT)
+
+ conn.set_listener("", Listener())
+ conn.start()
+ conn.send(body=json.dumps(msg), destination=DESTINATION)
+
+ try:
+ signal.pause()
+ except KeyboardInterrupt:
+ pass
+
+ conn.disconnect()
+
+
+def option_parser():
+ parser = optparse.OptionParser(usage='%prog [options] method [params]')
+ parser.add_option("-a", "--host", dest="host",
+ help="host address (default localhost)")
+ parser.set_defaults(host="localhost")
+ return parser
+
+
+def terminate():
+ os.kill(os.getpid(), signal.SIGINT)
+
+
+if __name__ == "__main__":
+ main(sys.argv[1:])
--
To view, visit http://gerrit.ovirt.org/35181
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6273eabf6f3601602659d1e4e748d8025ae8084
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has posted comments on this change.
Change subject: tests: Avoid global state modification using forked
......................................................................
Patch Set 1: -Code-Review
(1 comment)
https://gerrit.ovirt.org/#/c/67338/1/tests/moduleloader_test.py
File tests/moduleloader_test.py:
Line 39: for f in files:
Line 40: utils.touchFile(os.path.join(path, f))
Line 41: utils.touchFile(os.path.join(path, '__init__.py'))
Line 42: sys.path.append(os.path.dirname(path))
Line 43: yield importlib.import_module(os.path.basename(path))
> You don't need to monkey patch if you run in another process, this is compl
Do you suggest to run all tests (everywhere, not just this module) in a subprocess?
Line 44:
Line 45: @permutations(
Line 46: [(('a.py', 'b.py'), ('a', 'b')),
Line 47: (('a.py', 'b.py', 'a.pyc', 'a.pyioas'), ('a', 'b')),
--
To view, visit https://gerrit.ovirt.org/67338
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I2130bcf39918c3c70ed9f8eb9c436c5c8f9c6c09
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Irit Goihman <igoihman(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: Yes