Arik Hadas has posted comments on this change.

Change subject: Engine: Pre-started vms in vm pool display bad auditlog message
......................................................................


Patch Set 2:

(1 comment)

http://gerrit.ovirt.org/#/c/35394/2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java:

Line 568:                 if (getSucceeded()) {
Line 569:                     boolean isStateless = 
isStatelessSnapshotExistsForVm();
Line 570:                     if (isStateless) {
Line 571:                         return 
AuditLogType.VDS_INITIATED_RUN_VM_AS_STATELESS;
Line 572:                     } else if (getFlow() == 
RunVmFlow.CREATE_STATELESS_IMAGES) {
> It is the same...
michal, your suggestion will work only because of the check in line 562, 
otherwise by checking "else if (!isVdsKnown)" you would get the same audit log 
for both cases where the stateless snapshot was created successfully and where 
it is removed successfully - thus it is fragile since it counts on the order of 
those checks.

I prefer to check explicitly that we're in the flow of the stateless snapshot 
creation instead of checking it implicitly by assuming that this is the only 
flow in which the synch part ends successfully and no vds is set.
Line 573:                         return 
AuditLogType.VDS_INITIATED_RUN_AS_STATELESS_VM_NOT_YET_RUNNING;
Line 574:                     } else {
Line 575:                         return AuditLogType.VDS_INITIATED_RUN_VM;
Line 576:                     }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I6ce736c1b24265a13b147ffae235428ddbd597e4
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <shav...@redhat.com>
Gerrit-Reviewer: Arik Hadas <aha...@redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skriva...@redhat.com>
Gerrit-Reviewer: Shahar Havivi <shav...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
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