Allow break bond with attached network while VM is running.

The problem was that we counted tap device on the bridge as part of bond
because of wrong behaviour of getNicsVlanAndBondingForNetwork.

Change-Id: I183e2f4cf780a0eb79a416cdc4afc387893ee106
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=875487
Signed-off-by: Igor Lvovsky <ilvovsky@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/9384
Reviewed-by: Mark Wu <wudxw@linux.vnet.ibm.com>
Reviewed-by: Hunt Xu <mhuntxu@gmail.com>
Tested-by: Meni Yakove <myakove@redhat.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
nwfilter, vmChannels: pep8 fixes

Change-Id: Icf34f7d99d969cc08e3aa2da779769ae796300d1
Signed-off-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/9434
Reviewed-by: Zhou Zheng Sheng <zhshzhou@linux.vnet.ibm.com>
Tested-by: Zhou Zheng Sheng <zhshzhou@linux.vnet.ibm.com>
pep8: have a space after all operators, not before colon

Change-Id: I24a0b990395242dff75ed72b42dce944060e0b26
Signed-off-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/9436
Reviewed-by: Zhou Zheng Sheng <zhshzhou@linux.vnet.ibm.com>
Tested-by: Zhou Zheng Sheng <zhshzhou@linux.vnet.ibm.com>
pep8: fix libvirtconnection.py

Change-Id: Ie6fef13e80b2330dbc65c3440ceb994c5c6903b5
Signed-off-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/9437
Reviewed-by: Zhou Zheng Sheng <zhshzhou@linux.vnet.ibm.com>
Tested-by: Zhou Zheng Sheng <zhshzhou@linux.vnet.ibm.com>
spec: Add MOM as a package dependency

For oVirt 3.2, we are switching to MOM for KSM tuning.  One of the goals of this
release is to ensure that MOM is running in all deployed oVirt hosts (ovirt-node
and standalone).  A recent enough version of MOM is now available upstream for
Fedora and RHEL and we build nightly RPMs on ovirt.org.  I think we are ready to
add this packaging dependency now.

Change-Id: I8e8c5a67066f270b8f19881ac5871ff844dbecaa
Signed-off-by: Adam Litke <agl@us.ibm.com>
Reviewed-on: http://gerrit.ovirt.org/9272
Reviewed-by: Doron Fediuck <dfediuck@redhat.com>
Reviewed-by: Mark Wu <wudxw@linux.vnet.ibm.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
mom: Report the status of the mom threads

It will be useful to check on the status of the MOM threads.  Add a new field to
the HostStats structure to provide this information.

Change-Id: Ibd36a5c3a91abfa3fa29c811ce9b3586bf0bda36
Signed-off-by: Adam Litke <agl@us.ibm.com>
Reviewed-on: http://gerrit.ovirt.org/9287
Reviewed-by: Doron Fediuck <dfediuck@redhat.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Remove REST bindings

No one uses them and no one should. We are going in a different
direction for a supported API and keeping the rest bindings alive is
confusing and cumbersome.

Change-Id: I6c2a2909323e943e076db8443ce84f839eab874c
Signed-off-by: Saggi Mizrahi <smizrahi@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/7754
Reviewed-by: Adam Litke <agl@us.ibm.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Tested-by: Dan Kenigsberg <danken@redhat.com>
libvirtev.py: move to site_packages/vdsm

Until we drop this little module, it has to sit within the vdsm package,
or else `from vdsm import libvirtconnection` would fail.

Bug-Url: https://bugzilla.redhat.com/870985
Change-Id: Ieffbc359880e87a7159906579a18b2e5c63bd763
Signed-off-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/9435
Tested-by: Yaniv Bronhaim <ybronhei@redhat.com>
Reviewed-by: Yaniv Bronhaim <ybronhei@redhat.com>
hooks: add the nested virtualization hook

If the nested virtualization is enabled in your kvm module this hook
will expose it to the guests.

Change-Id: I08c24c1b932370577e9687d75e292cd7c40f8e5d
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/9225
Reviewed-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Tested-by: Ohad Basan <obasan@redhat.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
vdsm.spec: Add packages versions for rhel7

Add condition for RHEL7 packages.

Change-Id: Ia556789f9a2456f255d822f7e28877168d603f6e
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/9428
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
upgrade: make sure that the lease files have correct permission

Fix a bug where we tried to initialize sanlock lock before calling
the function to set proper permissions.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=870024
Change-Id: If28c48d2aeedd092ff3b8100dd64cd8ba673e94f
Signed-off-by: Haim Ateya <hateya@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/9517
Reviewed-by: Yaniv Bronhaim <ybronhei@redhat.com>
Reviewed-by: Federico Simoncelli <fsimonce@redhat.com>
Reviewed-by: Saggi Mizrahi <smizrahi@redhat.com>
remoteFileHandler.py: nit fix for poll mask

poll() should use POLLERR/POLLHUP instead of EPOLLERR/EPOLLHUP

Change-Id: Ic9d51fc2fed7da0a7ce0639c4ce668b28883d4f9
Signed-off-by: Royce Lv<lvroyce@linux.vnet.ibm.com>
Reviewed-on: http://gerrit.ovirt.org/9513
Reviewed-by: Saggi Mizrahi <smizrahi@redhat.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Tested-by: Dan Kenigsberg <danken@redhat.com>
miscTests: using MACRO instead of string

Change-Id: I005dee7f14e239c36cf1d8e6632406991e410ac5
Signed-off-by: Royce Lv<lvroyce@linux.vnet.ibm.com>
Reviewed-on: http://gerrit.ovirt.org/9465
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Tested-by: Dan Kenigsberg <danken@redhat.com>
Cisco VM-FEX support vdsm hooks

Moved the lock to handleDirectPool

Change-Id: I45a7fa46919bb39a648dff190c40618395990e91
Author: Dan Yasny <dyasny@gmail.com>
Signed-off-by: Dan Yasny <dyasny@gmail.com>
Reviewed-on: http://gerrit.ovirt.org/7547
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Tested-by: Meni Yakove <myakove@redhat.com>
Adopt the change in xml output format

'gluster volume status --xml' output added values under
<volumes/volume> levels.  This change is taken up in the parsing.

Change-Id: Icfb5c622b369d4ecd1ee0010595bec25557fe0c2
Signed-off-by: Bala.FA <barumuga@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/9323
Reviewed-by: Timothy Asir <tjeyasin@redhat.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
tests: Drop abberant AttributeError

PoolHandler.__del__ may be called by Python after the reference to
zombieReaper module has been reset to None. This leads to an annoying
    AttributeError: 'NoneType' object has no attribute 'autoReapPID'
when tests finish.

This commit swallows this error.

Change-Id: Id11acbffcbc9faaef54a2ba3b24ed82c8710f51c
Signed-off-by: Saggi Mizrahi <smizrahi@redhat.com>
Signed-off-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/9395
libvirtvm: prepare for <interface type='network'>

In the near future (actually, in the following patch), I would like to
define virtual interfaces with <source network>. If such a VM is
migrated to a host expecting <source bridge>, bad thing would happen.

This patch extracts <interface>'s network for bridge- and network-based
interfaces alike. It should be applied to all the hosts in the cluster
before generating the first network-based interface.

Change-Id: Ib1eeb8c008d95c8812d855c7e073b5f78ffd67b2
Signed-off-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/9531
Reviewed-by: Antoni Segura Puimedon <asegurap@redhat.com>
Reviewed-by: Hunt Xu <mhuntxu@gmail.com>
Extract a method _getCapsXMLStr() to get capabilities from libvirt

The new function  _getCapsXMLStr() could be shared by _getCpuTopology()
and _getEmulatedMachines(). And it also saves a libvirt call by memorizing
the result.

Change-Id: I004693d64c84479f150f05d348b2e843f48238a4
Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com>
Reviewed-on: http://gerrit.ovirt.org/9431
Reviewed-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Reviewed-by: Hunt Xu <mhuntxu@gmail.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Tested-by: Dan Kenigsberg <danken@redhat.com>
pep8: fix remaining vdsm/*.py

Change-Id: Ie4e0a0bdeb5f8a014b336fe32583cf9fc9c3cec4
Signed-off-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/9584
Reviewed-by: Zhou Zheng Sheng <zhshzhou@linux.vnet.ibm.com>
Tested-by: Zhou Zheng Sheng <zhshzhou@linux.vnet.ibm.com>
libvirtvm: Avoiding snapshot metadata creation

After creating a new snapshot, it is not possible to live-migrate:

  libvirtError: Requested operation is not valid: cannot migrate domain
with 1 snapshots

Issue is also affecting storage live migration due to use of the same vm
snapshot function during the live storage migration process.

This patch introduces the libvirt flag needed to avoid snapshot metadata
creation.

Bug-Url: http://bugzilla.redhat.com/872277
Change-Id: I928983a404f822522a0a48218f9c58fa8d6296b1
Signed-off-by: Amador Pahim <apahim@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/9139
Reviewed-by: Federico Simoncelli <fsimonce@redhat.com>