Michael Pasternak has posted comments on this change.
Change subject: restapi: VM-runtime-only information presented after VM goes
down (#869682)
......................................................................
Patch Set 1: I would prefer that you didn't submit this
(5 inline comments)
....................................................
File
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java
Line 284: if (osType != null) {
Line 285: os.setType(osType.value());
Line 286: }
Line 287: }
Line 288: if (getIsVmRunning(entity) && entity.getboot_sequence()
!= null) {
boot_sequence is irrelevant to vm state
Line 289: for (Boot boot :
map(entity.getdefault_boot_sequence(), null)) {
Line 290: os.getBoot().add(boot);
Line 291: }
Line 292: }
Line 311: VmPool pool = new VmPool();
Line 312: pool.setId(entity.getVmPoolId().toString());
Line 313: model.setVmPool(pool);
Line 314: }
Line 315: if (getIsVmRunning(entity) && entity.getrun_on_vds() != null)
{
why do we need to do it in api? it should be done by backend,
i.e entity.getrun_on_vds() should return null.
Line 316: model.setHost(new Host());
Line 317: model.getHost().setId(entity.getrun_on_vds().toString());
Line 318: }
Line 319: if (entity.getdefault_display_type() != null) {
Line 322:
model.getDisplay().setType(map(entity.getDynamicData().getdisplay_type(),
null));
Line 323: } else {
Line 324:
model.getDisplay().setType(map(entity.getdefault_display_type(), null));
Line 325: }
Line 326: if (getIsVmRunning(entity) && entity.getDynamicData() !=
null) {
why not moving this code after line 321?
Line 327: model.getDisplay().setAddress(entity.getdisplay_ip());
Line 328: Integer displayPort = entity.getdisplay();
Line 329: model.getDisplay().setPort(displayPort==null ||
displayPort==-1 ? null : displayPort);
Line 330: Integer displaySecurePort =
entity.getdisplay_secure_port();
Line 361: Domain domain = new Domain();
Line 362: domain.setName(entity.getvm_domain());
Line 363: model.setDomain(domain);
Line 364: }
Line 365: if (getIsVmRunning(entity) && entity.getvm_ip()!=null &&
!entity.getvm_ip().isEmpty()) {
why this is not done by the backend?
entity.getvm_ip() should return null when vm is down
Line 366: model.setGuestInfo(new GuestInfo());
Line 367: model.getGuestInfo().setIps(new IPs());
Line 368: for (String item : entity.getvm_ip().split(" ")) {
Line 369: if (!item.equals("")) {
....................................................
Commit Message
Line 8:
Line 9: VM-runtime-only display information is presented by api after VM goes
down
Line 10:
Line 11: The runtime only information like address, port, secure_port,
start_time and
Line 12: boot priority need to be hidden when the vm is not running.
why to hide boot-priority?
Line 13:
Line 14: Change-Id: Ie36fa8049c8ddad483e7e16f13a3d0a029f8f218
Line 15: Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=869682
--
To view, visit http://gerrit.ovirt.org/9090
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie36fa8049c8ddad483e7e16f13a3d0a029f8f218
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ravi Nori <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Ravi Nori <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches