Allon Mureinik has posted comments on this change.

Change subject: core:unlock_entity is not locating locked snapshots
......................................................................


Patch Set 2: Looks good to me, but someone else must approve

(3 inline comments)

There are several places where you use ilike instead of = - functionally they 
are the same in this case, but performance wise "=" should be a bit better.

Up to you if you want to fix or not.

....................................................
File backend/manager/dbscripts/common_sp.sql
Line 531:     if (v_recursive) then
Line 532:         update images set imagestatus = OK where imagestatus = LOCKED 
and
Line 533:         image_group_id in (select device_id from vm_device where 
vm_id = v_id and is_plugged);
Line 534: 
Line 535:         update snapshots set status = SNAPSHOT_OK where status ilike 
SNAPSHOT_LOCKED and vm_id = v_id;
use "=" instead of "ilike" - it's pointless since SNAPSHOT_LOCKED doesn't 
include any wildcards
Line 536:     end if;
Line 537: END; $procedure$
Line 538: LANGUAGE plpgsql;
Line 539: 


....................................................
File backend/manager/dbscripts/dbfunctions.sh
Line 469:             image_group_id in
Line 470:             (select device_id from vm_device where is_plugged);"
Line 471:        psql -w -c "${CMD}" -U ${USERNAME} -d "${DATABASE}" -h 
"${SERVERNAME}" -p "${PORT}"
Line 472:        CMD="select vm_name as vm_name, snapshot_id as snapshot_id  
from vm_static a ,snapshots b
Line 473:             where a.vm_guid = b.vm_id and status ilike 
'${SNAPSHOT_LOCKED}';"
use "=" instead of "ilike"
Line 474:        psql -w -c "${CMD}" -U ${USERNAME} -d "${DATABASE}" -h 
"${SERVERNAME}" -p "${PORT}"
Line 475:    elif [ "${object_type}" = "template" ]; then
Line 476:        CMD="select vm_name as template_name from vm_static
Line 477:                   where template_status = ${TEMPLATE_LOCKED};"


Line 492:                   imagestatus = ${LOCKED} and is_plugged;"
Line 493:    elif [ "${object_type}" = "snapshot" ]; then
Line 494:        CMD="select vm_id as entity_id, snapshot_id
Line 495:             from snapshots a
Line 496:             where status ilike '${SNAPSHOT_LOCKED}';"
use "=" instead of "ilike"
Line 497:        psql -w -c "${CMD}" -U ${USERNAME} -d "${DATABASE}" -h 
"${SERVERNAME}" -p "${PORT}"
Line 498:    fi
Line 499: }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I415be6fbe99a97740c9d4e9c55c1ad63bc689531
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to