Fix get vms list function name

The host shutdown function was using a function that does not exist
in the class.

Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo@linux.vnet.ibm.com>
Packaging: add the basemodel.py to src/kimchi/Makefile.am

src/kimchi/basemodel.py is a common model builder and is imported by several models from src/kimchi/model, and it is not in src/kimchi/Makefile.am, so make install, make dist and make rpm do not install or package this file.

Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com>
Avoid useless libvirt error log produced by featuretests

When running feature tests, we get bunch of error messages as below:

*** Running feature tests ***
libvirt: Domain Config error : internal error unknown protocol type 'http'
libvirt: Domain Config error : internal error unknown protocol type 'https'
libvirt: Domain Config error : internal error unknown protocol type 'ftp'
libvirt: Domain Config error : internal error unknown protocol type 'ftps'
libvirt: Domain Config error : internal error unknown protocol type 'tftp'
Cannot find '' in path: No such file or directory
*** Feature tests completed ***

By replacing default error handler of libvirt, this patch succeeded to
avoid the errors. After Featuretest, the default error handler will be restored.
The default error handler (in libvirtmod.so) just do one thing, it prints the
error message to stderr before we catch the exception in python.

Independent of the error, it will be logged into kimchi error log file.
That way we can easily debug the system.

Signed-off-by: apporc <appleorchard2000@gmail.com>
Signed-off-by: Aline Manera <alinefm@br.ibm.com>
Add a method to fix read permission on ISO files

When starting a virtual machine, libvirt changes the user:group of the disk
files to libvirt-qemu or qemu (depends on Linux distribution)
That way libvirt can work properly with those files.

But if the file does not have read permission, libvirt won't be able to
access them.

This patch adds a method to add read permission on files to avoiding
problems when starting a virtual machine.

Also remove useless imports from utils.py

Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
Signed-off-by: Aline Manera <alinefm@linux.vnet.ibm.com>
Signed-off-by: Royce Lv <lvroyce@linux.vnet.ibm.com>
Remove kvmusertests.py

As libvirt changes the user:group of disk files we don't need to probe
the username of qemu process
We just need to add read permission for those files as they already will
be owned by libvirt.

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
Make sure ISO files have read permission while starting VM

libvirt needs to have read permission on cdrom files in order to start
the virtual machine without problems.

Otherwise, the user will get the following error:

$ sudo virsh start aaaa
error: Failed to start domain aaaa
error: internal error process exited while connecting to monitor: kvm:
-drive file=/root/Fedora-Live-Desktop-x86_64-19-1.iso: could not open disk image
/root/Fedora-Live-Desktop-x86_64-19-1.iso: Permission denied

So make sure the ISO file has read permission before starting the
virtual machine.

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
bug fix: Fix shallow scan broken after model refactoring

The shallow scan is always return an empty array as it is trying to
access the pool name as a libvirt pool object.
Fix it to restore shallow scan functionality.

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