testrunner: Add NOSE_COLOR env var

Allows forcing output of color to non terminal.

Useful for case where the errors are longer then the scrollback:

    NOSE_COLOR=1 ./run_tests_local.sh jsonRpcTests | less -R

Change-Id: I4eb684c73f6254a35707fcd7f3f6b30eaaae9f2f
Signed-off-by: Saggi Mizrahi <smizrahi@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/12302
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Tested-by: Dan Kenigsberg <danken@redhat.com>
vdsm.spec.in: with_gluster

Option to manage Gluster sub-package.

Change-Id: Ifebbd38d3d225c22f1f39a2f8758591066824e76
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/13542
Reviewed-by: Federico Simoncelli <fsimonce@redhat.com>
vdsmd.init.in: removing /var/log/vdsm/libvirt.log

We added it quite long ago to track libvirt lost event issues.
These days we are much stable and libvirtd.log already contains
libvirt informations.

Change-Id: I2b777c42b29a747bfdc647af56a0e7d56c16194f
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=928217
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/13728
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
vdsm: fix Vm cleanup routine

The issue was that on Vm disk hot unplug the general clean up routine
was called, that wiped out also qemu and ovirt guest agent's sockets.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=927143
Signed-off-by: Peter V. Saveliev <peet@redhat.com>
Change-Id: Ie355022866d008a83257b1b6e3a4226a07d34c2f
Reviewed-on: http://gerrit.ovirt.org/13610
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-by: Vered Volansky <vvolansk@redhat.com>
vdsm: Ignore after_vm_cont hook if _dom was not yet created

There's a race condition happening which results in an exception because the
domain has not yet being assigned/created.

This is a workaround to fix the exception from happening, however this is not
a long term solution.

Change-Id: I0e36f988c965b51855861f04bcebee5ad51d3b09
Signed-off-by: Vinzenz Feenstra <vfeenstr@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/12558
Reviewed-by: Mark Wu <wudxw@linux.vnet.ibm.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Checking syslog availability before starting vdsm

If logger is not able to open /dev/log, it throws exception and vdsm
does not start. This path verifies that this file exist and fail vdsm
start if not.

Change-Id: I60d0537f67da3cf81477760ccb3760a103dc15ac
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=928861
Signed-off-by: Yaniv Bronhaim <ybronhei@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/13547
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Tested-by: Douglas Schilling Landgraf <dougsland@redhat.com>
vm: rename _updateDrive to updateDriveParameters

As preparation for change I472c2931 the method _updateDrive is renamed
to updateDriveParameters to avoid confusion with updateDriveVolume.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=923964
Change-Id: Ic60f1e0bcd889dffba9003d413fa305f6102eccf
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/13631
Reviewed-by: Ayal Baron <abaron@redhat.com>
Reviewed-by: Yeela Kaplan <ykaplan@redhat.com>
Tested-by: Dafna Ron <dron@redhat.com>
NetReload: ConfigWriter, ifup/down to configurator

NetworkReloaded mandates that the configuration done by
configNetworks shall be done using configurators that do the
step of modifying the state of the networking stack.

This patch moves ConfigWriter ifup and ifdown to the
ifcfg configurator module (in netconfg) while keeping everything
working. Next in the series there shall be patches that wrap
the methods that were moved into actions done to the Ifcfg
Configurator object.

Change-Id: I8f28fa717eb501f61ed922cf2571181ff3b42532
Signed-off-by: Antoni S. Puimedon <asegurap@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/13182
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Remove redundant parameter that breaks resourceManager test

Change-Id: I50f392061379832e625162750d3df547444b928a
Signed-off-by: Yeela Kaplan <ykaplan@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/13777
Reviewed-by: Saggi Mizrahi <smizrahi@redhat.com>
Don't user sudo in fuser

Change-Id: I74842ffda1bc1d5ebb54de5e1933fedd851e745b
Signed-off-by: Saggi Mizrahi <smizrahi@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/13779
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Tested-by: Antoni Segura Puimedon <asegurap@redhat.com>
vdsm: change default migration bandwidth in conf

Libvirt changed the default behaviour in migration bandwith
definition. Prior to versions 0.10.x it used "0" to define
default 32MBps limit, now it uses "0" to define unlimited
speed.

This patch preserves the former way, when the default was
32MBps. It needed in enterprise environments, where mass
migration with unlimited bandwith can have a serious impact
on the network infrastructure.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=925981
Signed-off-by: Peter V. Saveliev <peet@redhat.com>
Change-Id: If9f3ac98d1868504c04d80eea5fc50d1d8cb1939
Reviewed-on: http://gerrit.ovirt.org/13781
Reviewed-by: Michal Skrivanek <michal.skrivanek@redhat.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Remove storage messages from syslog

Storage messages are irrelevant to the syslog and still appear in the
vdsm log.
vdsm/storage/fileUtils.py is now logging to Storage.fileUtils.

Change-Id: I5c6283fc2d478d56fbf513f6bbf7e1541b708d95
Signed-off-by: Vered Volansky <vvolansk@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/13692
Reviewed-by: Allon Mureinik <amureini@redhat.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
svdsm: fix fuser import in supervdsmServer

Change-Id: I319a96e1357b5ed47ef5b6bcf3dec0ce678b9748
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/13804
Reviewed-by: Yaniv Bronhaim <ybronhei@redhat.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
spec: use the fedora systemd macros

Add the support for the fedora systemd macros introduced in fedora 18.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=850412
Change-Id: I76857a6b9ae1a945511f359333735b9497c5e2b0
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/12285
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
spec: enable gluster upstream and on fedora 19

The gluster package should be always enabled upstream or since fedora 19
in koji builds.

Change-Id: I68436bf10cecdaea8b3ce6c95797aac4895ec482
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/13791
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Device custom properties: Cache device XML after hotplug

We now cache new device XML after diskHotplug and nicHotplug,
just like we cache device XML when they are created during
vmCreate.

Change-Id: I1d7a78b6b9cff6484b97d42560092292b38d02c4
Signed-off-by: Assaf Muller <amuller@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/13802
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Separate sampling code from vdsm.utils

vdsm.utils should only include helper functions which could be shared
different modules. Sampling is a separate function, so it should be
moved out of utils. It could resolve the problem of circular import.

Change-Id: I1de4c81b3cf202f9f548a59b86ef0c8a97c2af19
Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com>
Reviewed-on: http://gerrit.ovirt.org/13838
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
vdsm.spec: increase policycoreutils version for RHEL

Due bz#893065 if selinux is disable vdsm package can not
be installed on RHEL systems.

Change-Id: Ib2b40781e4e6bba28ac5ebcf54ff089bad09e36d
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=903309
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/11341
Reviewed-by: Mark Wu <wudxw@linux.vnet.ibm.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Catch appropriate KeyError instead of any exception

resourceManager.registerNamespace() raises a KeyError exception.
Calling methods were catching any exception, treating all as
KeyError, which means non-KeyError exceptions were swallowed. Now only
KeyErrors are caught and logged as info (instead of warn), and other
potential exceptions are not caught at all, i.e., not swallowed
anymore.

Change-Id: Ifc0fa5ca50e4eb78d62fd3cdc8b09723486bcaa0
Signed-off-by: Vered Volansky <vvolansk@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/13617
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
NetReload: Moved addNetwork logic to the configurator

This change starts moving the logic of configNetwork API endpoints
towards the configurators.

configureBridge, configureVlan, configureBond and configureNic
after this patch have to take care of the underlying devices
explicitly in the configurator modules. However, the underlying
device handling will be abstracted to the network models in a
future patch. Thus, the code of configureBond for any configurator
such as Ifcfg is gonna be something like:

self.configWriter.addBonding(params)
for slave in bond.slaves:
    slave.configure(params)

Change-Id: I877eddc07a17f0bdd376df7bab8b19ffe52f72ba
Signed-off-by: Antoni S. Puimedon <asegurap@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/13268
Reviewed-by: Dan Kenigsberg <danken@redhat.com>