Omer Frenkel has posted comments on this change. Change subject: core: add NEXT_RUN snapshot ......................................................................
Patch Set 2: (3 comments) http://gerrit.ovirt.org/#/c/26757/2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetVmNextRunConfigurationQuery.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetVmNextRunConfigurationQuery.java: Line 14: Line 15: @Override Line 16: protected void executeQueryCommand() { Line 17: SnapshotVmConfigurationHelper snapshotVmConfigurationHelper = getSnapshotVmConfigurationHelper(); Line 18: Snapshot snapshot = getSnapshotDao().get(getParameters().getId(), Snapshot.SnapshotType.NEXT_RUN, getUserID(), getParameters().isFiltered()); > how about checking if the snapshot is null right after and return in case i basically i prefer to use early-return, anyway in the new patch-set i changed the code to call getVmById, in case of a race where the caller thinks there is a snapshot and its deleted in the mean-while Line 19: VM vm = null; Line 20: Line 21: if (snapshot != null) { Line 22: vm = snapshotVmConfigurationHelper.getVmFromConfiguration( http://gerrit.ovirt.org/#/c/26757/2/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/Snapshot.java File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/Snapshot.java: Line 275: REGULAR("Regular"), Line 276: ACTIVE("Active"), Line 277: STATELESS("Stateless"), Line 278: PREVIEW("In Preview"), Line 279: NEXT_RUN("Next Run"); > will "Next Run" be presented to the user? no Line 280: Line 281: private String typeName; Line 282: Line 283: private SnapshotType(String typeName) { http://gerrit.ovirt.org/#/c/26757/2/packaging/dbscripts/create_views.sql File packaging/dbscripts/create_views.sql: Line 625: vm_dynamic.last_watchdog_event as last_watchdog_event, vm_dynamic.last_watchdog_action as last_watchdog_action, vm_dynamic.is_run_once as is_run_once, vm_dynamic.vm_fqdn as vm_fqdn, vm_dynamic.cpu_name as cpu_name, vm_dynamic.current_cd as current_cd, vm_dynamic.reason as reason, vm_dynamic.exit_reason as exit_reason, Line 626: vm_static.instance_type_id as instance_type_id, vm_static.image_type_id as image_type_id, vds_groups.architecture as architecture, vm_static.original_template_id as original_template_id, vm_static.original_template_name as original_template_name, vm_dynamic.last_stop_time as last_stop_time, Line 627: vm_static.migration_downtime as migration_downtime, vm_static.template_version_number as template_version_number, Line 628: vm_static.serial_number_policy as serial_number_policy, vm_static.custom_serial_number as custom_serial_number, Line 629: vm_static.is_boot_menu_enabled as is_boot_menu_enabled, (snapshot_id is not null) as next_run_config_exists > "snapshots.snapshot_id"? Done Line 630: FROM vm_static INNER JOIN Line 631: vm_dynamic ON vm_static.vm_guid = vm_dynamic.vm_guid INNER JOIN Line 632: vm_static AS vm_templates ON vm_static.vmt_guid = vm_templates.vm_guid INNER JOIN Line 633: vm_statistics ON vm_static.vm_guid = vm_statistics.vm_guid INNER JOIN -- To view, visit http://gerrit.ovirt.org/26757 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4d68f1d7a2de9e66854985583761f47d6db553bd Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Omer Frenkel <[email protected]> Gerrit-Reviewer: Arik Hadas <[email protected]> Gerrit-Reviewer: Michal Skrivanek <[email protected]> Gerrit-Reviewer: Omer Frenkel <[email protected]> Gerrit-Reviewer: Roy Golan <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
