core: UpdateVmDiskCommand - synthetic access warn

Changed modifiers from private to protected to avoid synthetic access
warnings.

This may also result in a slight performance improvements, but I doubt
it would be noticeable.

Relates-To: https://bugzilla.redhat.com/854964
Change-Id: I07ed8b37f4c22807b8981959b7b03d7baa19de68
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: UpdateVmDiskCommandTest.cretaeVirtIODisk

Removed the unused method in the subject.

Relates-To: https://bugzilla.redhat.com/854964
Change-Id: I26220721869b786be5eb30521914c6d934a485d1
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: UpdateVmDisk: unify other disk retrieval

Several validations in the canDoAction() rely on getting the VM's other
disks from the database, which is unfortunately done in the said several
places.

This patch unifies them all to a lazy getter, getOtherVmDisks() for
better performance and readability.
Besides the code change, it also introduces a couple of new unit tests
to ensure that no functionality was damaged.

Relates-To: https://bugzilla.redhat.com/854964
Change-Id: I31bcb767bf86d6f16116cfa06a710bb0488b087f
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: Cleanup AttachDiskToVmCommand.canDoAction()

Made the canDoAction() more readable by removing the lock checks (should
be handled by the CommandBase infra using @LockiIdNameAttribute) and
employing the early-return idiom.

Relates-To: https://bugzilla.redhat.com/854964
Change-Id: I6cb0cc87c82387e8b1dcac0142f3625a4cc232d2
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: AddDiskCommand.canDoAction() early return

Made AddDiskCommand.canDoAction() slightly more readable using the
early-return idiom.

Relates-To: https://bugzilla.redhat.com/854964
Change-Id: Ib89b5008972e6cf895941d211cda5d7f8f14b5e1
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: Cleanup AbstractDisk.isDiskCanBeAddedToVm

Extracted the updateDisksFromDb() method from isDiskCanBeAddedToVm()
method for better encapsulation, and employed the early-return idiom for
better readability.

Relates-To: https://bugzilla.redhat.com/854964
Change-Id: If7e5aafada5012ae06c7105bafa5538026e42b1b
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: UpdateDiskToVm: use isDiskCanBeAddedToVm

Used AbstractDiskCommand's isDiskCanBeAddedToVm(Disk) instead of
duplicating the same code.

Relates-To: https://bugzilla.redhat.com/854964
Change-Id: I6fef2259e2543fd47880a37dd8434838575db45b
Signed-off-by: Allon Mureinik <amureini@redhat.com>