engine : Add User Id to async tasks table

Add user id to async tasks table, the user id
will be used to determine if the user has permissions
to see the tasks for which the user requested statuses

When tasks are retrieved from vdsm after server restart
the user id information is not available and will be set
to Guid.Empty when tasks are created

Change-Id: Ib5b9f3dfb38d6d56f186aa87f3ff75007a0d3997
Bug-Url: https://bugzilla.redhat.com/1153043
Signed-off-by: Ravi Nori <rnori@redhat.com>
engine : query execution failed due to insufficient permissions

Adding a disk using a user with DiskCreator
privileges logs insufficient permissions
message in the log

Change-Id: I11adfe9c49d1e57ecc88d1828ed63884016c33e8
Bug-Url: https://bugzilla.redhat.com/1153043
Signed-off-by: Ravi Nori <rnori@redhat.com>
aaa: Pass password across filters so it will be known during LoginUserCommand

As basic authentication passed auth record to Login filter, the passsword
used for authentication was not passed, hence was not set in the session data container.

Change-Id: Ie48f8f1408b17882337f4fd0a8c38f7829472cf2
Bug-Url: https://bugzilla.redhat.com/1141541
Topic: AAA
Signed-off-by: Yair Zaslavsky <yzaslavs@redhat.com>
(cherry picked from commit 3d4c423269b8dd099b2fe4bce43b0d2efa6f9e33)
core: validate osinfo properties files - fail backend on error

validate the osinfo properties files by the order of loading.
on-error, a RuntimeException is thrown, which should fail the backend
from loading.

The parsing itself is implemented using ANTLR parser and lexer
generator and the Osinfo.g4 grammar file.

Osinfo.g4
grammar file that expresses the syntax of the properties file and
except for unique validation needs should be the only place to be
changed when needed.

OsinfoPreferencesParser.java
the tool to parse a property file with and match is against the syntax

  OsinfoPreferencesParser.parse("path/to/file")

Change-Id: Ie33bf9446857e15d13221271120a3ff2b400350c
Bug-Url: https://bugzilla.redhat.com/1056965
Signed-off-by: Roy Golan <rgolan@redhat.com>
core: Hot plug CPU - allow over-commit in QEMU limits

Allow to hot plug CPUs up to QEMU limits[1] even if they over-commit the
host resources.

[1] http://doc.opensuse.org/products/draft/SLES/SLES-kvm_sd_draft/cha.kvm.limits.html

Change-Id: Ic27aefa52543b201d018d07296de1e4983bfb863
Bug-Url: https://bugzilla.redhat.com/1097195
Signed-off-by: Roy Golan <rgolan@redhat.com>
packaging: fail the build if osinfo-defaults.properties fails to parse

check the properties file we ship with the exact code that checks it
at runtime when the engine loads.

this test is hooked into the packaging process and must fail it.

Change-Id: I9aead46c067134dbc59b83ad70d1715ec004587c
Bug-Url: https://bugzilla.redhat.com/1056965
Signed-off-by: Roy Golan <rgolan@redhat.com>
core: Renamed the getStorageDomainId Method

The method's name implies that it's a simple getter, even though it does
not always return the expected storage domain even if it exists
(permissions issues for example).
Thus, renamed to getStorageDomainIdForQuery.

Change-Id: I93e7fdda6ffacb0fc1fd740fe69390864100ab7b
Related-To: https://bugzilla.redhat.com/1085398
Signed-off-by: Idan Shaby <ishaby@redhat.com>
core: Renamed StorageDomainDAO.getStorageDomainByTypeAndPool

The method's parameters types are clear enough, so there's no need to
include them also in the method's name.

Change-Id: Iffc63c3a22488e459be3c9beac9dd5d0163f0d12
Related-To: https://bugzilla.redhat.com/1085398
Signed-off-by: Idan Shaby <ishaby@redhat.com>
core: Renamed StorageDomainDAODbFacadeImpl.getStorageDomainIdForPoolByType

The method's parameters types are clear enough, so there's no need to
include them also in the method's name.

Change-Id: Ifea93a14062b5d0483c8492b82444c34097ff71d
Related-To: https://bugzilla.redhat.com/1085398
Signed-off-by: Idan Shaby <ishaby@redhat.com>
core: Empty Change CD List when ISO is Inactive

The VM's Change CD list should be empty when the ISO domain in the DC is
inactive.

Change-Id: I784be2510e2f51be277f7ee06a5bd5573ab23d66
Bug-Url: https://bugzilla.redhat.com/1085398
Signed-off-by: Idan Shaby <ishaby@redhat.com>
packaging: spec: add support for EL7 builds

Change-Id: Id6fcef7e48cc1f616b09b4c3cb42b9bb92a8259f
Bug-Url: https://bugzilla.redhat.com/1159293
Signed-off-by: Sandro Bonazzola <sbonazzo@redhat.com>
Revert "core: Improve performance of getdisksvmguid"

This reverts commit d9e489471aaf0113fac7dff63845dee6f7f4523e.

UNION removes duplicate records, UNION ALL does not.
Hence, 'all_disks_including_snapshots' view includes duplicate
records for copied template disks.
Performance improvement should probably be achieved in another way.
In the mean time, reverting this change.

Change-Id: I5f6a0859a6000124e7968e5725ed7e5232b1a5cf
Bug-Url: https://bugzilla.redhat.com/1161612
Signed-off-by: Daniel Erez <derez@redhat.com>
webadmin: Fixed out of frame load balancer boxes.

In the "New Scheduling Policy" dialog, extended the height of the
frame. Also, Added new css style "separatorStyle" with margins for
the seperators to adjust the style to the height change.

Change-Id: Ic4342dc06d11d0d7c884e9f6b0ecbc25b3934db5
Bug-Url: https://bugzilla.redhat.com/1142897
Signed-off-by: Tomer Saban <tsaban@redhat.com>
webadmin: Fixed UI for popup New CPU QoS

In the popup "New CPU Qos", the scroll bar was removed and also,
margin was added for the "Limit" textbox so it will be aligned with the
rest of the textboxes.

Color for the "Limit" row wasn't changed(It was decided to leave it
as is).

Change-Id: I4aebf602a70b7b65f65d45e388b5d49296ed0be7
Bug-Url: https://bugzilla.redhat.com/1142813
Signed-off-by: Tomer Saban <tsaban@redhat.com>
restapi: Avoid NPE in request for CDROMs of wrong VM

Currently when we receive a request for the collection of CDROMs of a VM
we don't take into account that the query performed to find the VM can
return null if there isn't such a VM (the identifier is wrong, or the VM
has been removed). To avoid that NPE this patch checks the result of the
query and will respond with an empty list in those cases.

Change-Id: Id17ef36193c21e113d4abafeee0c769a2a948bd3
Bug-Url: https://bugzilla.redhat.com/1150953
Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
(cherry picked from commit f1dc8f77e611a2b8f40ddac822032632833d4eb0)
frontend: Clear Inactive ISO Domain Images List

When an ISO domain is not active, navigating to its images subtab
should not query for the images, but show an empty list.

Change-Id: Idb29eb14a07a8084b62bda5ac41769ce964bac16
Bug-Url: https://bugzilla.redhat.com/1155191
Signed-off-by: Idan Shaby <ishaby@redhat.com>
webadmin: Date formatting when deleting a snapshot

When deleting a VM's snapshot a formatted date is now shown based on a
constant taken from another component in the system (DiskGeneralModel)
for system consistency. this constant is intended to be exported to
some util class later on.

Bug-Url: https://bugzilla.redhat.com/1158959
Change-Id: I5d6a3f43557696fd35256b4a3fc55a5fbf59fdba
Signed-off-by: Amit Aviram <aaviram@redhat.com>
webadmin: glance domain - fix images tab

Glance storage domain are unattached, hence, shouldn't
be checked against Active status (change has been introduced
in change-Id Idb29eb14a07a8084b62bda5ac41769ce964bac16
to prevent query on inactive domains).

Change-Id: I5cdad6f443b19ad240b3c60c0f8f62798aca7bd8
Bug-Url: https://bugzilla.redhat.com/1161941
Signed-off-by: Daniel Erez <derez@redhat.com>
packaging:[ver2] fail the build if osinfo-defaults.properties fails to parse

check the properties file we ship with the exact code that checks it
at runtime when the engine loads.

this test is hooked into the packaging process and must fail it.

Change-Id: Icaecda7d278fa898838f04547d5ab44e5ca6b3d9
Bug-Url: https://bugzilla.redhat.com/1056965
Signed-off-by: Roy Golan <rgolan@redhat.com>
webadmin: Correction of UI Constants

Messages that was using the word "Detach" incorrectly, namely using
capital "D" when there was no need to- changed to "detach".
In addition, the "Data Center" part of the message who related
to detaching storage from a data center has changed back to
"Data Center(s)" due to the fact that it is possible that some
chosen Storage is attached to more than one Data Center.

Change-Id: Id288103a417db6aee13e3f990b2d0af3fb3827f7
Bug-Url: https://bugzilla.redhat.com/1152558
Relates-To:https://bugzilla.redhat.com/1149457
Signed-off-by: Amit Aviram <aaviram@redhat.com>