core: LiveMigrateDisk - check isRunningOrPaused VMStatus

LiveMigrateDiskCommand - check isRunningOrPaused VMStatus instead of
isUpOrPaused [to prevent command failure when the VM changes
running status (e.g. RebootInProgress) while live migrating)].

Change-Id: I546dbe5e225ee0db5ca190d3237b70c5a425e004
Bug-Url: https://bugzilla.redhat.com/923992
Signed-off-by: Daniel Erez <derez@redhat.com>
core: prevent rollback on VmReplicateDiskFinish success

Preventing rollback on execution success
(moved rollback avoidance logic to revertTask).

Change-Id: I06a8d395c729e915ece4e0ff413cb006542d4785
Bug-Url: https://bugzilla.redhat.com/923992
Signed-off-by: Daniel Erez <derez@redhat.com>
core: Removed the unused GetStorageStatisticsQuery

This patch removes the unused GetStorageStatisticsQuery and its
corresponding constant in VdcQueryType.

Note that the query's code was commented out anyway.

Change-Id: I31475d3394c1446653678e0a5cd4f910d7fccb00
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: Removed unused GetXXXMessageQurey classes

The GetXXXMessagesQuery classes are no longer in use, and thus are
removed from the code base.

This path contains the following:
1. Removing the GetXXMessagesQuery classes.
2. Removing the GetXXMessagesParameteres classes used by the
   aforementioned query classes.
3. Removing the constants in VdcQueryType that correspond to the
   aforementioned removed queries.
4. Removing the GetMessagesByIdParameterBase which was the base class
   for all the aforementioned parameter classes and modifying
   GetAllEventMessagesQuery, which was the only query to use
   GetMessagesByIdParameterBase directyly to use
   VdcQueryParameterBase instead of it.
5. Removing the UserMessageController class which was only used by the
   GetUserMessageQuery class.

Change-Id: I747d1bc71bda99717e7816a6674d30e99ed007c8
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: Remove GetResourceUsage constant

Removed the enum constant VdcQueryType.GetResourceUsage since the
GetResourceUsageQuery class it represents is long gone, and is no longer
available in the code base.

Change-Id: Ie0ec4b45f293ea15f97155175695edbd7888bb99
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: Remove unused licensing VdcQueryTypes.

Removed the enum constants GetLicenseProperties and
GetLicenseProductType, as their corresponding query objects no longer
exist, and on their own they are useless.

Change-Id: I02cc5f5d99c2a016320c4a397e872e3a7ace8842
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: Remove unused GetTimeLeasedUsersByVmPoolId

Removed the unused GetTimeLeasedUsersByVmPoolId query.

This patch removes:
1. The GetTimeLeasedUsersByVmPoolIdQuery class
2. The GetTimeLeasedUsersByVmPoolIdParameters class only used by the
   aforementioned query.
3. The GetTimeLeasedUsersByVmPoolId constant from VdcQueryType
   representing the aforementioned query.
4. The getAllTimeLeasedUsersForVm(int) method from DbUserDAO, its
   implementation and its "test", as it was only used by the
   aforementioned query. Note that the underlying stored procedure no
   longer exists, so this DAO would not have worked anyway.

Change-Id: I7db6131e621dd1f34d023565d87c1a6afecbf2fa
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: Remove GetAdGroupsAttechedToTimeLeaseVmPool

GetAdGroupsAttechedToTimeLeaseVmPoolQuery is not used anywhere in the
code, and thus should be removed.

This patch removes the following:
1. The GetAdGroupsAttechedToTimeLeaseVmPoolQuery class.
2. The GetAdGroupsAttechedToTimeLeaseVmPoolParameters class only
   used by the aforementioned query class.
3. The GetAdGroupsAttechedToTimeLeaseVmPool constant in VdcQueryType
   corresponding to the aforementioned query class.
4. The getAllTimeLeasedForPool(int) method from AdGroupDAO and its
   implementation. Note that the underlying stored procedure called
   from this method no longer exists, so it could not have worked
   anyway.

Change-Id: Idd4265f3f979a76f70d9dcabf5b69e05fc9a0708
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: Remove GetVmsRunningOnVDSCount

GetVmsRunningOnVDSCountQuery is not used anywhere in the
code, and thus should be removed.

This patch removes the following:
1. The GetVmsRunningOnVDSCountQuery class.
2. The GetVmsRunningOnVDSCountParameters class only
   used by the aforementioned query class.
3. The GetVmsRunningOnVDSCount constant in VdcQueryType
   corresponding to the aforementioned query class.

Change-Id: Iba10fb35ece3a9bc6ba9f5cbe43086d14e440262
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: Remove GetVmsRunningOnVDS

GetVmsRunningOnVDSQuery is not used anywhere in the
code, and thus should be removed.

This patch removes the following:
1. The GetVmsRunningOnVDSQuery class.
2. The GetVmsRunningOnVDSParameters class only
   used by the aforementioned query class.
3. The GetVmsRunningOnVDS constant in VdcQueryType
   corresponding to the aforementioned query class.

Change-Id: I519f1c4c74eb641b7251a830f5eb2317d868a9db
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: export vm/create template shouldn't include ILLEGAL disks

When exporting a VM/Creating a template - return CDA message when there
are image disks which are in ILLEGAL status, this prevents the following:
*additional vdsm commands
*possible status change from ILLEGAL to ok
*failure of the entire operation

Change-Id: I6e608c0c87c6e3a8d275fd74658b888cde6c8694
Bug-Url: https://bugzilla.redhat.com/921489
Signed-off-by: Liron Aravot <laravot@redhat.com>
packaging: Fix properties tag in standalone.xml

In a previous commit (299d26) we added the system-properties tag twice
inside the standalone.xml file. It needs to be there only once.

Change-Id: I074449a7409b1b4cf090a441518f9c08cd3334ad
Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
core: Fix empty quota events tab

The Events sub tab under the quota always remained empty.

The reasons for that were:
 a. The quota id was never saved in the audit_log table in the DB
 b. The search query for quota events was parsed wrong

Added the quota ID and name to the AuditLogableBase.
Added correct parsing for the search to recognize 'quota' as an object.

Change-Id: I207db27df01705660dc33874cd0e222028c0ff63
Bug-Url: https://bugzilla.redhat.com/920226
Signed-off-by: Ofri Masad <omasad@redhat.com>
core: create 3.0 compatible ovf when export from 3.0 compatible cluster

This patch fix a problem that exporting VM/template from a 3.0
compatibility cluster resulted in a ovf file that wasn't 3.0 compatible,
therefore couldn't be imported in 3.0 environment.

There were 2 changed in the ovf files since 3.0:
1. The disk aliases are no longer in the pattern "Drive 1", "Drive 2"...
2. The usb-policy values changed from ["Enabled", "Disabled"] to
["ENABLED_NATIVE", "ENABLED_LEGACY", "DISABLED"]

So now, the export process checks the compatibility version of the
cluster to which the resource belongs, and create the ovf file with the
values that match that version.

Note that this is a quick-and-dirty fix. it is planned to be
re-implemented with a better design so that the code will be more
maintainable.

Change-Id: I5e7ecfd7c71a5c22ed7751de9f46b690d5236643
Signed-off-by: Arik Hadas <ahadas@redhat.com>
engine: Version cleanup

- replaced String concatenation with StringBuilder
- replaced reference comparison with strings to StringBuilder length
  check
- refactored the version component addition to a new method
  appendVersionComponent

Change-Id: I7dba498fa54bae997d08e7457dd53eb60a740199
Signed-off-by: Laszlo Hornyak <lhornyak@redhat.com>
engine: Version.equals cleanup

Just removed the redundant if statement

Change-Id: Ia1486f70b5881a8bea1bcfbf2031687c55c07567
Signed-off-by: Laszlo Hornyak <lhornyak@redhat.com>
userportal: memory leak in extended resources

- Fixed memory leak in VmTable, it was holding onto
references to the Vm entities when clearing the Tree.
- Fixed memory leak in AbstractUiCommonModelEditorDriver adding
a visitor on each refresh.

Change-Id: Ie6a6fff003ae1315291de2add063047c14803e75
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=913142
Signed-off-by: Alexander Wels <awels@redhat.com>
engine: replace ParameterizedRowMapper

Since spring 3.0, ParameterizedRowMapper does not add anything to
RowMapper, but utility methods accepting ParameterizedRowMapper are now
deprecated. To remove these deprecated calls, this patch replaces the
ParameterizedRowMapper with simple RowMapper.
At this point ovirt uses spring 3.1.1

Change-Id: Iffb0216403509a069e072b0594ab547295038d5c
Signed-off-by: Laszlo Hornyak <lhornyak@redhat.com>
engine: remove SimpleJdbcTemplate

Since spring 3.1, the SimpleJdbcTemplate class does the same as
JdbcTemplate, therefore wrapping JdbcTemplate is not needed anymore and
SimpleJdbcTemplate is deprecated. This patch removes the wrapping
SimpleJdbcTemplates from DAO implementations.

Change-Id: I8782d8790ee682b64d2b14af8840f90b7b7216a9
Signed-off-by: Laszlo Hornyak <lhornyak@redhat.com>
engine: remove unused VmPayload constructor

VmPayload constructor was never used, removing it also gets rid of a
deprecated method call.

Change-Id: I4e78d7f6edf4d043098aae936782e2466ee15221
Signed-off-by: Laszlo Hornyak <lhornyak@redhat.com>