Remove orphaned files

This patch removes files than are neither mentioned in any code nor
shipped int the dist tar file.

Change-Id: Ibce1a6c8044fdeae49d6f563a90383a58bf9b170
Signed-off-by: Dima Kuznetsov <dkuznets@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/35724
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-by: Yeela Kaplan <ykaplan@redhat.com>
tests: sampling: add initial HostStatsThread tests

This patch adds a unit test to HostStatsThread.

Change-Id: Ic4e5765364cf46e1ebfaac72aa5f75c80e83779e
Relates-To: https://bugzilla.redhat.com/1113948
Signed-off-by: Francesco Romani <fromani@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/29566
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Fixed %post script error during upgrade

During post script we initiates vdsm-tool set-saslpasswd call. On
upgrade we have mixed code that may lead to an error while calling
vdsm-tool script, as in the related bug.
In this patch we move the call to set-saslpasswd to init scripts. In
pre-script phase we can be sure that the newer code is running.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1168689
Change-Id: Ib7808f4f217ba3d6d30a60fab6233e36a29f0098
Signed-off-by: Yaniv Bronhaim <ybronhei@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/35739
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
move _netinfo and libvirt_nets decleration right before it's used

Change-Id: I8c49201eef9dace3dba8944440989a96c3300442
Signed-off-by: ibarkan <ibarkan@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/35687
Reviewed-by: Antoni Segura Puimedon <asegurap@redhat.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
rename networksAdded to connectivity_check_networks

Change-Id: I452e051c1a82734097550c13c766967283386c79
Signed-off-by: ibarkan <ibarkan@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/35688
Reviewed-by: Antoni Segura Puimedon <asegurap@redhat.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
rename networkAttrs to attrs

Change-Id: I978aad73b0981785b3e7e05d94b8f7d0250fd82f
Signed-off-by: ibarkan <ibarkan@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/35689
Reviewed-by: Antoni Segura Puimedon <asegurap@redhat.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Revert Ib7808f4f217ba3d6d30a60fab6233e36a29f0098 and add set-sasl to
spec

To avoid upgrade issue and set the sasl password during installation,
this workaround change the use in vdsm-tool to direct call.

Bug-Url : https://bugzilla.redhat.com/show_bug.cgi?id=1168689
Signed-off-by: Yaniv Bronhaim <ybronhei@redhat.com>
Signed-off-by: Yaniv Bronhaim <ybronhei@redhat.com>
Change-Id: Ibfc751aaa79f8d6374efec8d6c594ba7a1ad5607
Reviewed-on: http://gerrit.ovirt.org/35763
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Tested-by: Dan Kenigsberg <danken@redhat.com>
tests: fix HostStatsThread tests

In commit 4567f368bc3b initial tests for HostStatsThread
were added. Unfortunately, the patch was verified
on branch, not on master, so master branch broke
when the patch got merged.

The mistake slipped into because
* the parent patch contained the code which made the
  test work ok, and was abandoned (see below).
* 4567f368bc3b applied cleanly against mastr.

This followup patch fixes that in the following way
- mark test as broken: the existing behaviour is *not*
  to continue in presence of errors - see
  http://gerrit.ovirt.org/#/c/29401/ abandoned
  for that reason.
- wrap a real HostSample to be more correct
- add a timeout to avoid hang indefinitely.

Change-Id: Iefeacf5f105384040b4a81f9835faa1fa5033c07
Signed-off-by: Francesco Romani <fromani@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/35764
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Do not extend volume beyond truesize

When calling getNextVolumeSize on a volume that is close to fully
allocated, the function can return a value larger than the volume's real
capacity.  Add an explicit ceiling to prevent this.

Change-Id: Ib616224d88c886700a7f121eaf6da84ba8276e55
Signed-off-by: Adam Litke <alitke@redhat.com>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1155583
Reviewed-on: http://gerrit.ovirt.org/35757
Reviewed-by: Allon Mureinik <amureini@redhat.com>
Reviewed-by: Francesco Romani <fromani@redhat.com>
Reviewed-by: Federico Simoncelli <fsimonce@redhat.com>
Live Merge: Proactively extend merge target volume

Since libvirt is not yet providing the write watermark information for
all volumes, we need to employ a workaround to support live merge on
block-based storage.  When starting a merge, we can request the base
volume (merge target) to be extended to the size of the top volume
(merge source) plus one chunk to accomodate active writing.  This may
cause some over-extension of the merge target volume but the upside is
that the merge should complete without active monitoring.  Future
versions of oVirt will take advantage of an upcoming libvirt enhancement
to report write watermarks for all volumes which will allow on-demand
volume extension.

Change-Id: I3d483f9dfe6e19a9f9fec84950bf2ea0c7ed7946
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1155583
Signed-off-by: Adam Litke <alitke@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/35614
Reviewed-by: Allon Mureinik <amureini@redhat.com>
Reviewed-by: Francesco Romani <fromani@redhat.com>
Reviewed-by: Federico Simoncelli <fsimonce@redhat.com>
storage: Search only the current image for children

The getChildren method of FileVolume is currently searching all images
in the storage domain for children.  A glob of all metadata files in the
SD is cached and then passed to grep to look for the child volumes.  The
problem is that deleteVolumes takes an exclusive lock on the image
namespace only.  If deletes are active on other images at the same time
we'll get errors with missing files.

The code attempts to report the children of a template base volume.
However, this is not needed now and is not expected to be required in
the future.  The getVolsOfImage API should be used for templates.
Therefore, we can fix this race by limiting the search for children to a
single image.

Change-Id: I2ef9012cee3a8cb891926510c10ecc47b7cddaa1
Signed-off-by: Adam Litke <alitke@redhat.com>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1069610
Reviewed-on: http://gerrit.ovirt.org/35096
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-by: Federico Simoncelli <fsimonce@redhat.com>
sosreport: Don't try to collect info from sockets

sosreport gets an IOError trying to collect data
from svdsm.sock:
'caught IO error copying /var/run/vdsm/svdsm.sock'

Change-Id: I2aa8df2a8d16c7a3468cd7cad21fe598b33b8500
Signed-off-by: Yeela Kaplan <ykaplan@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/35513
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Changing persisted value to libvirt logrotate configure

Setting persisted to false means that is-configured won't check the
status of this file. This to avoid differences between ovirt-3.4
configuration to ovirt-3.5 in /etc/logrotate.d/libvirtd

In ovirt-3.4 we set the prefix of the configuration without the conf
version, therefore in 3.5 we alerted that libvirt is not configured
and asked to run vdsm-tool configure all-over again without having any
differences between the versions.

Change-Id: I3f1c4d5d513e8699543727fff9f30a8213c66bfd
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1168695
Signed-off-by: Yaniv Bronhaim <ybronhei@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/35758
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
do not delete networks from parameters

Change-Id: I546c7f196f4b6bdace528a0cbbe6cfe5a212bfe1
Signed-off-by: ibarkan <ibarkan@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/35690
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
factor out parts of setupNetworks for better readability

Change-Id: Icb26c288b8f466e5f1009d889dacf3e17d45891c
Signed-off-by: ibarkan <ibarkan@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/35691
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
removed unused argument copies

Change-Id: Id25e07ef13bc5fb1a9c59794aa2c41bb77c79d7e
Signed-off-by: ibarkan <ibarkan@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/35692
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
factor out hook logic in setupNetworks

Change-Id: Iad0808bc2fc6260636390af925ca754ed6c51de1
Signed-off-by: ibarkan <ibarkan@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/35693
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
remove updating libvirt_nets, it has no effect

Change-Id: I5e4999b33419353627f7a127cbe61e8ebcb04148
Signed-off-by: ibarkan <ibarkan@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/35694
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
vdsm: add functionality to detach host devices

Detach call (libvirt's dettach/detachFlags call) is required to
properly detach device from host. Dettaching device from the host means
unbinding it from it's driver and binding it to VFIO driver, which
serves as KVM device driver.

Change-Id: I530fed56831314286942b8afa62900208812bfb5
Signed-off-by: Martin Polednik <mpolednik@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/32389
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
vdsm: add functionality to reattach host devices

Release call (libvirt's reAttach call) is mandatory to properly
reattach device back to host, unbinding it from VFIO driver and
binding it back to host driver.

Change-Id: I77000c76ece87bf7335045429eab207a89badae9
Signed-off-by: Martin Polednik <mpolednik@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/32391
Reviewed-by: Dan Kenigsberg <danken@redhat.com>