Francesco Romani has posted comments on this change.

Change subject: WIP: engine: fetch exit reason from VDSM
......................................................................


Patch Set 5:

(2 comments)

http://gerrit.ovirt.org/#/c/23946/5/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmExitReason.java
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmExitReason.java:

Line 20: 
Line 21:     private final static VmExitReason[] reasons = values(); // cache 
the array
Line 22: 
Line 23:     public int getValue() {
Line 24:         return this.ordinal();
> look at VmStatus.java -
Done
Line 25:     }
Line 26: 
Line 27:     public static VmExitReason forValue(int value) {
Line 28:         return reasons[value+1]; // because we prepended Unknown(-1)


http://gerrit.ovirt.org/#/c/23946/5/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java:

Line 223:         if (xmlRpcStruct.containsKey(VdsProperties.exit_message)) {
Line 224:             String exitMsg = (String) 
xmlRpcStruct.get(VdsProperties.exit_message);
Line 225:             vm.setExitMessage(exitMsg);
Line 226:         }
Line 227:         if (xmlRpcStruct.containsKey(VdsProperties.exit_reason)) {
> still wondering why can't we settle with exit_code.
No strong preferences here. Is just I'd like to maximize backward 
compatibility, but I don't have any problem extending the exit status and 
dropping the extra field if this turns out to be more convenient.
Line 228:             String exitReasonStr = 
xmlRpcStruct.get(VdsProperties.exit_reason).toString();
Line 229:             
vm.setExitReason(VmExitReason.forValue(Integer.parseInt(exitReasonStr)));
Line 230:         } else {
Line 231:             vm.setExitReason(VmExitReason.Unknown);


-- 
To view, visit http://gerrit.ovirt.org/23946
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib36f06f3ba63a743d624e417fe2c96b84dda60be
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skriva...@redhat.com>
Gerrit-Reviewer: Roy Golan <rgo...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to