Implement integrity verification: don't disable network used by guest

do not allow to delete a network when the network is used by more than
one guest.
do not allow to deactivate a network when the network is used by more
than one guest with running state.

add a filter for _get_vms_attach_to_a_network

Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
Fix exception for model test

We don't start server in model test so cherrypy.request.app is None
and exception translation cannot be used.
Just do translation when server started.

Signed-off-by: ShaoHe Feng<shaohef@linux.vnet.ibm.com>
Signed-off-by: Royce Lv<lvroyce@linux.vnet.ibm.com>
Setup VM's input and output template for Power systems.

Setup the bus for keyboard and mouse to 'usb' by default and prevent the
sound configuration to be added for new Power guests.

Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com>
bug fix: Package doc html files into deb package

To get the help html files dinamically the Makefile was using the
following code:

DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita))
$(wildcard *.html)

But it does not well while building deb packages as it cointans
duplicated values:

 /bin/mkdir -p '/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help'
 /usr/bin/install -c -m 644 guests.html storage.html templates.html
guests.html index.html storage.html templates.html
'/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help'
/usr/bin/install: will not overwrite just-created
`/tmp/tmp.86vGERYO70/usr/share/kimchi/ui/pages/help/guests.html' with
`guests.html'
(...)

So use $(if()) statement to get html files from one source or from
another to avoid the errors above.

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
doc: Generate index.html to join all help pages

This patch generates help/index.html automatically based on all .dita
files during build time.
For each dita file it generates a link on index.html

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
ui: Add tooltip when hovering long names

If the storage pool or network names are very long strings, they are
trimmed (e.g. "myverylongnetworkname" becomes something like "myverylo...").
If multiple names have the same prefixes, the user will not be able to
distinguish them.

Add tooltips displaying the full names when hovering storage pool and
network names.

Signed-off-by: Crístian Viana <vianac@linux.vnet.ibm.com>
Fix encode and decode in storagevolumes.py

Storage volume list return value and lookup parameter is not properly
encode and decode, fix it.

Signed-off-by: Royce Lv <lvroyce@linux.vnet.ibm.com>
Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
Remove unused vms reference in VMModel

VMModel has unused vms reference, remove it.

Signed-off-by: Royce Lv <lvroyce@linux.vnet.ibm.com>
Add software update action to Host resource

Instead of handling the update packages action in
PackagesUpdate(Collection) move it to Host(Resource) to avoid
misunderstanding about the URI.

From /packagesupdate/update URI the "update" can be understood as the
resource item instead of the action.
So use /host/swupdate to update the packages marked to be updated.

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
Bug fix: methods signature in storagetargets.py

The lack of the 'self' keyword was causing bugs when trying to
create a nfs pool.

Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
bug fix: Properly check if there running vms before rebooting system

The user only can reboot or shutdown the host if there is no running
virtual machine.
During the model refactoring it kept using the function vms_get_list()
which does not exist in the host view.
So fix it.

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
Bug fix #318 Kimchi fails creating new network

NetworkModel does not have the method _get_network. So, the method
get_network form NetworksModel become a static method and now are
available to be use in src/kimchi/model/networks.py.

Signed-off-by: Ramon Medeiros <ramonn@linux.vnet.ibm.com>
Add one more case to network tests

Add a test without subnet while creating a network interface, to test
bug https://github.com/kimchi-project/kimchi/issues/318.

Signed-off-by: Ramon Medeiros <ramonn@linux.vnet.ibm.com>
Block access for non-root users

Non-root users must have restricted access to Kimchi.
This patch block non-root urser to:
- get or create debug reports;
- reboot or shutdown host system;
- create, activate/deactivate or delete networks;
- create, activate/deactivate or delete storage pools;
- update or delete templates;
- create, start/stop/connect or delete vms.

It also updates the tests cases to always run as a root user.
And add authorization tests to make sure non-root users have restricted
access to kimchi.

Signed-off-by: Aline Manera <alinefm@br.ibm.com>