userportal: redo patch 12748: show the correct VM's console type

The console type presented in VMs lists at the user-portal (basic +
extended) is based on the default display type defined for the VMs,
which is not always right because VM can be run in Run-Once mode
with a display type which is different from the default.

This patch ensure that the right console type is displayed for each VM
in the user portal by changing the way the console type is determined -
if the VM is running then we determine the console type according to the
actual display type (presented by the display type field in VmDynamic),
and according to the default display type, as before, only if the VM is
not running.

Change-Id: I488ceeba48c02e21b19762260a21d0efe1a2eab9
Bug-Url: https://bugzilla.redhat.com/907776
Signed-off-by: Arik Hadas <ahadas@redhat.com>
core: Added validation for host NIC name length

Linux apparently limits NIC names to be at most 15 characters long, so I
enforced that rule on our corresponding entities.

Change-Id: I901734ef19ae63c5879c19022bb2ed229a23b3a3
Signed-off-by: Lior Vernia <lvernia@redhat.com>
core: Added validation for bond name format

Added enforcement for bond names of the form "^bond\d*$", the format
assumed and used by VDSM. This is to enable adding new bonds from the
engine.

Change-Id: Id4ea20997c03c35c1f47d9ab12a49a39dd9c778a
Signed-off-by: Lior Vernia <lvernia@redhat.com>
webadmin: Fix VM pop-up Host tab

In the VM pop-up view, host tab - the logic of the UI visibility and
availability is wrong.

CPU pinning topology textbox should always be visible.
Both 'Use Host CPU' and 'CPU Pinning topology' are unavailable for
clusters with compatibility version under 3.2.

Logic of the flags 'Use Host CPU' and 'CPU Pinning topology' should be
as follows:

A = 'cpu pinning' available
B = 'use host cpu' available

For RHEV:
                              Any                 Selected
                              Host                   Host
-------------------------------------------------------------
Allow auto migration
Allow Man. migration           B
Do not allow migration         B                     A+B

For oVirt:
                              Any                 Selected
                              Host                   Host
-------------------------------------------------------------
Allow auto migration                                  A
Allow Man. migration           B                      A
Do not allow migration         B                     A+B

Change-Id: Ibe691e0292a6bf99521629f04d292698ba1027e5
Bug-Url: https://bugzilla.redhat.com/905831
Signed-off-by: Ofri Masad <omasad@redhat.com>
webadmin: Console connect button availability fix

This patch fixes the behavior of console button availability broken by
I00158bbd. For the availability check, the ConsoleUtils is used.
It also removes the event for connecting to console (it was needed because
uicommonweb is not under gin management). Now the UiCommonDefaultTypeResolver
is used for resolving needed classes (adding new interfaces/moving classes was
needed to make this possible).

The signature of the methods of the console options persister is changed - the
console context parameter was removed because it's redundant (can be infered
from the model parameter).

Change-Id: If102303d6b5c5ac45959b87a540c8ea278c227c3
Signed-off-by: Frantisek Kobzik <fkobzik@redhat.com>
core: allow to perform hotplug/unplug/attach when vm is paused.

When a VM is paused there's no reason not to allow hot
plugging/unplugging/attaching a disk.

Change-Id: I6d950a1e7945e43ec5ee5ffa0f79c5f9536473a6
Bug-Url: https://bugzilla.redhat.com/918498
Signed-off-by: Liron Aravot <laravot@redhat.com>
core: OvfReader - set IsManaged to true for managed devices

When reading ovf data, managed devices were added to the managed devices
map - but the isManaged flag wasn't set to true, causing that possibly
wrong data would be persisted/used.

Related to Bug-Url: https://bugzilla.redhat.com/882644

Change-Id: Ifa51f5aa6655b5b9ae6fd1a8c5e0c206fa9630e6
Signed-off-by: Liron Aravot <laravot@redhat.com>
packaging: move java compatiblity symlink where it can be created

Change-Id: I5f25123f492b78aa1f2a311c053aca12ec86c4bd
Signed-off-by: Alon Bar-Lev <alonbl@redhat.com>
core : AddVmFromSnapshot - use device information from snapshot.

When adding a vm from snapshot (clone of a snapshot), the device
information was taken from the vm current state and not from the
snapshot configuration - which caused the cloned vm to not be in the
desired state and possibly have missing devices.

Change-Id: I0611bbbef00fd2c2390ead5f3110e56dcaacd579
BUg-Url: https://bugzilla.redhat.com/show_bug.cgi?id=882644
Signed-off-by: Liron Aravot <laravot@redhat.com>
core: Locate data source in a loop

The deployment of the data source usually finishes before the
application is started, but in some situations, for example with slow
DNS, it can finish after the application has started, thus we can't
assume that it has already been deployed.

Change-Id: I72c99c61d05e8a1619c7d1fb70af956d1050eb3a
Bug-Url: https://bugzilla.redhat.com/879904
Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
core: Remove LdapSeachGroupsByQuery.initFromDb

Removed LdapSeachGroupByQueryCommand.initFromDb, since all it did was
query an LdapGroup and save it into a local variable that was never used
again.

Note that this patch solves a DLS_DEAD_LOCAL_STORE FindBugs warning on
this class.

Change-Id: I581fab9aa581a3a5093f98cc48edeaffc9080c44
Signed-off-by: Allon Mureinik <amureini@redhat.com>
tools: DLS in MangeDomains.getConfiguration()

Removed the DLs regarding the currentAuthorizationMethod in said
method.

Change-Id: If20c91e0af26154cab1b469a6240e3c79d20c400
Signed-off-by: Allon Mureinik <amureini@redhat.com>
webadmin: DLS in DragDropEventBase.getData

Removed the DLs regarding the dataTransfer in said
method.

Change-Id: I9c93490d018bf1cba5b78f096cf78e9ab2fcd346
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: clean RemoveStorageDomainCommand

Renamed connect/disconnect methods to start with lowercase
(java convention) and remove unused methods.

Change-Id: I2d15ce79acf17ed05108fdd7a4f00aa6470be3ad
Signed-off-by: Alissa Bonas <abonas@redhat.com>
core:  PRD32 - RFE: Multi-Tier fencing in RHEV-M

1) Removing the status check in the canDoAction such that for sequential
multiple agents secondary agent will still be used even tough the
primary agent is not reachable.
Also added an Alert in case that a primary agent failed to function and
a secondary agent is used in the case of sequential multiple agents.

Change-Id: Ieb5a3a8edeb58f74f0e74d3e54911f0cdb614762
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=773108
Signed-off-by: Eli Mesika <emesika@redhat.com>
userportal, webadmin: English locale to en_US

- Changed the English locale to be en_US to match the location
pointed to by the documentation.

Change-Id: I8fb5ac34f0e587b533c09bf26c24dcba81e9b41f
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=947176
Signed-off-by: Alexander Wels <awels@redhat.com>
userportal: Auto-Connect to RDP on Win 8 and Win 2012-64bit

Connect automatically doesn't take in effect that for Windows 8/2012 RDP is
default.

Steps to Reproduce:
1. Windows 8/2012 VM for user in the UP
2. Connect with auto-connect enabled from the login screen

Spice console appears instead of RDP one.
(As there is performance issue with unaccelerated SPICE console, RDP was agreed
to be default for Windows 8/2012. So make auto-connect to check this
correctly.)

Fixed by utilizing ConsoleUtils and ConsoleManager classes which are used for
connecting to console in regular use case. These classes take into account
that spice is unsupported on the mentioned platforms.

Change-Id: I33d8e4b4701f25bb64a7410512f17c266f872a86
Signed-off-by: Frantisek Kobzik <fkobzik@redhat.com>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=918605
engine: renamed ImageType to ImageFileType

Renamed, because the ImageType conflicts with the upcomning
Instance Type feature, where there will be this entities:
ImageType
InstanceType
TemplateType

Change-Id: I5e72e98776631755e5c0296fa5c255118fb39a54
Signed-off-by: Tomas Jelinek <tjelinek@redhat.com>
packaging: build: support subst more than once in line

Change-Id: Ie91ea6bb2765825c022ba699ddf1d7660298265f
Signed-off-by: Alon Bar-Lev <alonbl@redhat.com>
packaging: setup plugins should not be executable

Change-Id: I4d92a3af2d071780a8ec9f19e4c6e7debf6074d0
Signed-off-by: Alon Bar-Lev <alonbl@redhat.com>