Liron Aravot has posted comments on this change.

Change subject: core: introducing OvfAutoUpdate
......................................................................


Patch Set 18: (58 inline comments)

....................................................
File backend/manager/dbscripts/storages_sp.sql
Line 97:     WHERE  vm_id IN (
Line 98:         SELECT vm_guid
Line 99:         FROM   vms
Line 100:         WHERE  storage_pool_id = v_id);
Line 101:     delete FROM vm_static where vm_guid in (select vm_guid from vms 
where storage_pool_id = v_id);    
mkublin, take a look please at ovf table definition - this column is defined 
with ON DELETE CASCADE.

storage_pool_id UUID REFERENCES storage_pool(id) ON DELETE CASCADE
Line 102:       -- Get (and keep) a shared lock with "right to upgrade to 
exclusive"
Line 103:       -- in order to force locking parent before children
Line 104:    select   id INTO v_val FROM storage_pool  WHERE id = v_id     FOR 
UPDATE;
Line 105: 


....................................................
File backend/manager/dbscripts/upgrade/03_02_1550_add_vm_generation_columns.sql
Line 10: 
Line 11: INSERT into vm_ovf_generations
Line 12: (SELECT vm.vm_guid, sp.id
Line 13: FROM vm_static vm ,storage_pool sp, vds_groups vg WHERE
Line 14: vg.storage_pool_id = sp.id AND vm.vds_group_id = vg.vds_group_id);
Done
Line 15: 
Line 16: -- Only pre-existing vms should have ovf_generation set to 1, so after 
we added
Line 17: -- the pre existing vms, the default should be 0.
Line 18: SELECT fn_db_change_column_type ('vm_ovf_generations', 
'ovf_generation', 'BIGINT DEFAULT 1','BIGINT DEFAULT 0');


....................................................
File backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql
Line 337: select 
fn_db_add_config_value('OvirtIsoPrefix','ovirt-node','general');
Line 338: select 
fn_db_add_config_value('oVirtISOsRepositoryPath','/usr/share/ovirt-node-iso','general');
Line 339: select 
fn_db_add_config_value('oVirtUpgradeScriptName','/usr/share/vdsm-reg/vdsm-upgrade','general');
Line 340: select 
fn_db_add_config_value('oVirtUploadPath','/data/updates/ovirt-node-image.iso','general');
Line 341: select 
fn_db_add_config_value('OvfUpdateIntervalInMinutes','1','general');
planned to change it before merge to ease verification by others that will 
download the patch and build, anyway - changed.
Line 342: select 
fn_db_add_config_value('OvfItemsCountPerUpdate','100','general');
Line 343: select fn_db_add_config_value('PayloadSize','8192','general');
Line 344: select fn_db_add_config_value('PosixStorageEnabled','false','2.2');
Line 345: select fn_db_add_config_value('PosixStorageEnabled','false','3.0');


....................................................
File backend/manager/dbscripts/vms_sp.sql
Line 4: Create or replace FUNCTION UpdateOvfGenerations(v_vms_ids 
VARCHAR(5000), v_vms_db_generations VARCHAR(5000))
Line 5:     RETURNS VOID
Line 6:     AS $procedure$
Line 7: DECLARE
Line 8: curs_vmids CURSOR FOR SELECT ID from fnSplitterUuid(v_vms_ids);
generally - using IN here couple the use to the split implementation, and 
forces us to have only one column in the result, furthermore..the 
implementation all over the code is with selecting ID from it - i want to keep 
it like that.

specifically  -  i need to fetch the column into the variable (lines 16-17), 
won't make any difference in my opinion.., plus that this is the implementation 
for this method all over the code, so i prefer to keep it for uniformity.
Line 9: curs_newovfgen CURSOR FOR SELECT id from 
fnSplitter(v_vms_db_generations);
Line 10: id UUID;
Line 11: new_ovf_gen BIGINT;
Line 12: BEGIN


Line 5:     RETURNS VOID
Line 6:     AS $procedure$
Line 7: DECLARE
Line 8: curs_vmids CURSOR FOR SELECT ID from fnSplitterUuid(v_vms_ids);
Line 9: curs_newovfgen CURSOR FOR SELECT id from 
fnSplitter(v_vms_db_generations);
generally - using IN here couple the use to the split implementation, and 
forces us to have only one column in the result, furthermore..the 
implementation all over the code is with selecting ID from it - i want to keep 
it like that.
Line 10: id UUID;
Line 11: new_ovf_gen BIGINT;
Line 12: BEGIN
Line 13:  OPEN curs_vmids;


Line 35:    AS $procedure$
Line 36: BEGIN
Line 37: RETURN QUERY SELECT ovf.vm_guid as vm_guid
Line 38:    FROM vm_ovf_generations ovf
Line 39:    WHERE ovf.vm_guid NOT IN (SELECT vm_guid FROM vm_static) AND 
ovf.storage_pool_id = v_storage_pool_id;
Done
Line 40: END; $procedure$
Line 41: LANGUAGE plpgsql;
Line 42: 
Line 43: 


Line 66:    AS $procedure$
Line 67: BEGIN
Line 68: RETURN QUERY SELECT templates.vmt_guid as vm_guid
Line 69:    FROM vm_templates_view templates, vm_ovf_generations generations
Line 70:    WHERE generations.vm_guid = templates.vmt_guid 
Done
Line 71:    AND templates.db_generation > generations.ovf_generation
Line 72:    AND templates.storage_pool_id = v_storage_pool_id;
Line 73: END; $procedure$
Line 74: LANGUAGE plpgsql;


Line 83: Create or replace FUNCTION GetVmsIdsForOvfUpdate(v_storage_pool_id 
UUID) RETURNS SETOF UUID
Line 84:    AS $procedure$
Line 85: BEGIN
Line 86: RETURN QUERY SELECT vm.vm_guid as vm_guid
Line 87:    FROM vms vm,  vm_ovf_generations ovf_gen
Done
Line 88:    WHERE vm.vm_guid = ovf_gen.vm_guid AND
Line 89:          vm.db_generation >  ovf_gen.ovf_generation AND
Line 90:          vm.storage_pool_id = v_storage_pool_id;
Line 91: END; $procedure$


Line 84:    AS $procedure$
Line 85: BEGIN
Line 86: RETURN QUERY SELECT vm.vm_guid as vm_guid
Line 87:    FROM vms vm,  vm_ovf_generations ovf_gen
Line 88:    WHERE vm.vm_guid = ovf_gen.vm_guid AND
Done
Line 89:          vm.db_generation >  ovf_gen.ovf_generation AND
Line 90:          vm.storage_pool_id = v_storage_pool_id;
Line 91: END; $procedure$
Line 92: LANGUAGE plpgsql;


Line 102: Create or replace FUNCTION DeleteOvfGenerations(v_vms_ids 
VARCHAR(5000))
Line 103:     RETURNS VOID
Line 104:     AS $procedure$
Line 105: BEGIN
Line 106:     DELETE FROM vm_ovf_generations where vm_guid in (SELECT ID from 
fnSplitterUuid(v_vms_ids));
1. done

2.generally - using IN here couple the use to the split implementation, and 
forces us to have only one column in the result, furthermore..the 
implementation all over the code is with selecting ID from it - i want to keep 
it like that.
Line 107: END; $procedure$
Line 108: LANGUAGE plpgsql;
Line 109: 
Line 110: 


Line 425:    AS $procedure$
Line 426: BEGIN
Line 427: INSERT INTO vm_static(description, mem_size_mb, os, vds_group_id, 
vm_guid, VM_NAME, 
vmt_guid,domain,creation_date,num_of_monitors,allow_console_reconnect,is_initialized,is_auto_suspend,num_of_sockets,cpu_per_socket,usb_policy,
 time_zone,auto_startup,is_stateless,dedicated_vm_for_vds, fail_back, 
default_boot_sequence, vm_type, nice_level, default_display_type, 
priority,iso_path,origin,initrd_url,kernel_url,kernel_params,migration_support,predefined_properties,userdefined_properties,min_allocated_mem,
 entity_type, quota_id, cpu_pinning, is_smartcard_enabled,is_delete_protected)
Line 428:       VALUES(v_description,  v_mem_size_mb, v_os, v_vds_group_id, 
v_vm_guid, v_vm_name, v_vmt_guid, v_domain, v_creation_date, v_num_of_monitors, 
v_allow_console_reconnect, v_is_initialized, v_is_auto_suspend, 
v_num_of_sockets, v_cpu_per_socket, v_usb_policy, v_time_zone, 
v_auto_startup,v_is_stateless,v_dedicated_vm_for_vds,v_fail_back, 
v_default_boot_sequence, v_vm_type, v_nice_level, v_default_display_type, 
v_priority,v_iso_path,v_origin,v_initrd_url,v_kernel_url,v_kernel_params,v_migration_support,v_predefined_properties,v_userdefined_properties,v_min_allocated_mem,
 'VM', v_quota_id, v_cpu_pinning, v_is_smartcard_enabled,v_is_delete_protected);
Line 429: INSERT INTO vm_ovf_generations(vm_guid, storage_pool_id) VALUES 
(v_vm_guid, (select storage_pool_id from vds_groups vg where vg.vds_group_id = 
v_vds_group_id)); 
Done
Line 430: END; $procedure$
Line 431: LANGUAGE plpgsql;
Line 432: 
Line 433: 


Line 480:          FETCH curs INTO id;
Line 481:          IF NOT FOUND THEN
Line 482:             EXIT;
Line 483:          END IF;
Line 484:          UPDATE vm_static SET db_generation  = db_generation + 1 
WHERE vm_guid = id;
to perform the update in order .
Line 485:       END LOOP;
Line 486: END; $procedure$
Line 487: LANGUAGE plpgsql;
Line 488: 


Line 720:    AS $procedure$
Line 721: BEGIN
Line 722: RETURN QUERY SELECT vm.*
Line 723:              FROM vms vm
Line 724:              WHERE vm.vm_guid in (SELECT ID from 
fnSplitterUuid(v_vms_ids));
generally - using IN here couple the use to the split implementation, and 
forces us to have only one column in the result, furthermore..the 
implementation all over the code is with selecting ID from it - i want to keep 
it like that.
Line 725: END; $procedure$
Line 726: LANGUAGE plpgsql;
Line 727: 
Line 728: 


....................................................
File backend/manager/dbscripts/vm_templates_sp.sql
Line 128: INSERT INTO vm_ovf_generations(vm_guid, storage_pool_id) VALUES 
(v_vmt_guid, (select storage_pool_id from vds_groups vg where vg.vds_group_id = 
v_vds_group_id));
Line 129: END; $procedure$
Line 130: LANGUAGE plpgsql;
Line 131: 
Line 132: 
Done
Line 133: 
Line 134: 
Line 135: 
Line 136: 


Line 128: INSERT INTO vm_ovf_generations(vm_guid, storage_pool_id) VALUES 
(v_vmt_guid, (select storage_pool_id from vds_groups vg where vg.vds_group_id = 
v_vds_group_id));
Line 129: END; $procedure$
Line 130: LANGUAGE plpgsql;
Line 131: 
Line 132: 
Done
Line 133: 
Line 134: 
Line 135: 
Line 136: 


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/OvfDataUpdater.java
Line 45: 
Line 46: public class OvfDataUpdater {
Line 47:     private static final Log log = 
LogFactory.getLog(OvfDataUpdater.class);
Line 48:     private static final OvfDataUpdater INSTANCE = new 
OvfDataUpdater();
Line 49:     private int ITEMS_COUNT_PER_UPDATE;
Done
Line 50:     protected static final int MAX_ITEMS_PER_SQL_STATEMENT = 100;
Line 51: 
Line 52:     private List<Guid> proccessedIdsInfo;
Line 53:     private List<Long> proccessedOvfGenerationsInfo;


Line 46: public class OvfDataUpdater {
Line 47:     private static final Log log = 
LogFactory.getLog(OvfDataUpdater.class);
Line 48:     private static final OvfDataUpdater INSTANCE = new 
OvfDataUpdater();
Line 49:     private int ITEMS_COUNT_PER_UPDATE;
Line 50:     protected static final int MAX_ITEMS_PER_SQL_STATEMENT = 100;
added as constant as requested in earlier patchset by mkublin - this is limit 
value that should prevent us from performing too long sqls regardless of 
ITEMS_COUNT_PER_UPDATE size.
Line 51: 
Line 52:     private List<Guid> proccessedIdsInfo;
Line 53:     private List<Long> proccessedOvfGenerationsInfo;
Line 54: 


Line 85:         for (storage_pool pool : storagePools) {
Line 86:             try {
Line 87:                 initProccessedInfoLists();
Line 88:                 log.infoFormat("OvfDataUpdater: Attempting to update 
VM OVFs in Data Center {0}",
Line 89:                         pool.getname());
Done
Line 90:                 updateOvfForVmsOfStoragePool(pool.getId());
Line 91: 
Line 92:                 log.infoFormat("OvfDataUpdater: Attempting to update 
template OVFs in Data Center {0}",
Line 93:                         pool.getname());


Line 180:                 if (verifyDisksNotLocked) {
Line 181:                     loadTemplateData(template);
Line 182:                     Long currentDbGeneration = 
getVmStaticDao().getDbGeneration(template.getId());
Line 183:                     // equals() is used because currentDbGeneration 
can be null in case that the template
Line 184:                     // was deleted during the run of OvfDataUpdater.
yeah, the vm might be deleted during the ovf data updater run, meaning the 
reloading the db_generation will return us null , therefore we must use equals 
here rather then == with auto unboxing (Long == long)
Line 185:                     if 
(template.getDb_generation().equals(currentDbGeneration)) {
Line 186:                         buildMetadataDictionaryForTemplate(template, 
vmsAndTemplateMetadata);
Line 187:                         proccessedIdsInfo.add(template.getId());
Line 188:                         
proccessedOvfGenerationsInfo.add(template.getDb_generation());


Line 207:      * update ovfs for updated/added templates since last for the 
given storage pool
Line 208:      * @param poolId
Line 209:      */
Line 210:     protected void updateOvfForTemplatesOfStoragePool(Guid poolId) {
Line 211:         List<Guid> templateIdsForUpdate = 
getVmAndTemplatesGenerationsDao().
Done
Line 212:                 getVmTemplatesIdsForOvfUpdate(poolId);
Line 213:         int i = 0;
Line 214:         while (i < templateIdsForUpdate.size()) {
Line 215:             int size = Math.min(templateIdsForUpdate.size() - i, 
ITEMS_COUNT_PER_UPDATE);


Line 290:      * loads additional need template data for it's ovf
Line 291:      * @param template
Line 292:      */
Line 293:     protected void loadTemplateData(VmTemplate template) {
Line 294:         if (template.getInterfaces() == null || 
template.getInterfaces().isEmpty()) {
just moved this code here, haven't changed it..currently that's impossible as 
we use at the moment commons collections  3.1 and this method was added in 3.2
Line 295:             template.setInterfaces(getVmNetworkInterfaceDao()
Line 296:                     .getAllForTemplate(template.getId()));
Line 297:         }
Line 298:     }


Line 301:      * loads additional need vm data for it's ovf
Line 302:      * @param vm
Line 303:      */
Line 304:     protected void loadVmData(VM vm) {
Line 305:         if (vm.getInterfaces().isEmpty()) {
that's copy-pasted code from VmHandler/VmTemplate Handler, if it worked before 
it should work now as well
Line 306:             
vm.setInterfaces(getVmNetworkInterfaceDao().getAllForVm(vm.getId()));
Line 307:         }
Line 308:         if (StringUtils.isEmpty(vm.getVmtName())) {
Line 309:             if (!Guid.Empty.equals(vm.getVmtGuid())) {


Line 345:                             @Override
Line 346:                             public Guid eval(Disk a) {
Line 347:                                 return a.getId();
Line 348:                             }
Line 349:                         })));
moved code, we put in the map the vm id and then a list of disks ids only.
Line 350:     }
Line 351: 
Line 352:     protected VmDAO getVmDao() {
Line 353:         return DbFacade.getInstance()


Line 350:     }
Line 351: 
Line 352:     protected VmDAO getVmDao() {
Line 353:         return DbFacade.getInstance()
Line 354:         .getVmDao();
Done
Line 355:     }
Line 356: 
Line 357:     protected VmTemplateDAO getVmTemplateDao() {
Line 358:         return DbFacade.getInstance()


Line 355:     }
Line 356: 
Line 357:     protected VmTemplateDAO getVmTemplateDao() {
Line 358:         return DbFacade.getInstance()
Line 359:         .getVmTemplateDao();
Done
Line 360:     }
Line 361: 
Line 362:     protected VmNetworkInterfaceDAO getVmNetworkInterfaceDao() {
Line 363:         return DbFacade.getInstance().getVmNetworkInterfaceDao();


Line 364:     }
Line 365: 
Line 366:     protected VmAndTemplatesGenerationsDAO 
getVmAndTemplatesGenerationsDao() {
Line 367:         return DbFacade.getInstance()
Line 368:         .getVmAndTemplatesGenerationsDAO();
Done
Line 369:     }
Line 370: 
Line 371:     protected VmStaticDAO getVmStaticDao() {
Line 372:         return DbFacade.getInstance()


Line 369:     }
Line 370: 
Line 371:     protected VmStaticDAO getVmStaticDao() {
Line 372:         return DbFacade.getInstance()
Line 373:                 .getVmStaticDao();
Done
Line 374:     }
Line 375: 
Line 376:     /**
Line 377:      * init the lists contain the processed info.


Line 386:      * @param storagePoolId
Line 387:      * @param metaDictionary
Line 388:      * @param storageDomainId
Line 389:      * @return
Line 390:      */
there is try-catch (line 86)
i use the return value as this is what the api exposes, tommorow we can decide 
to eliminate the exception and return false for example..what's so harmful 
about it?
Line 391:     protected boolean executeUpdateVmInSpmCommand(Guid storagePoolId, 
Map<Guid, KeyValuePairCompat<String, List<Guid>>> metaDictionary, Guid 
storageDomainId) {
Line 392:         UpdateVMVDSCommandParameters tempVar = new 
UpdateVMVDSCommandParameters(storagePoolId, metaDictionary);
Line 393:         tempVar.setStorageDomainId(storageDomainId);
Line 394:         return 
Backend.getInstance().getResourceManager().RunVdsCommand(VDSCommandType.UpdateVM,
 tempVar)


Line 400:      * @param storagePoolId
Line 401:      * @param id
Line 402:      * @param storageDomainId
Line 403:      * @return
Line 404:      */
there is try-catch (line 86)
i use the return value as this is what the api exposes, tommorow we can decide 
to eliminate the exception and return false for example..what's so harmful 
about it?
Line 405:     protected boolean executeRemoveVmInSpm(Guid storagePoolId, Guid 
id, Guid storageDomainId) {
Line 406:         return 
Backend.getInstance().getResourceManager().RunVdsCommand(VDSCommandType.RemoveVM,
Line 407:                 new RemoveVMVDSCommandParameters(storagePoolId, id, 
storageDomainId)).getSucceeded();
Line 408:     }


....................................................
File 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/OvfDataUpdaterTest.java
Line 2: 
Line 3: import static org.junit.Assert.assertEquals;
Line 4: import static org.junit.Assert.assertFalse;
Line 5: import static org.junit.Assert.assertTrue;
Line 6: import static org.mockito.Matchers.*;
Done
Line 7: import static org.mockito.Mockito.doAnswer;
Line 8: import static org.mockito.Mockito.doCallRealMethod;
Line 9: import static org.mockito.Mockito.doNothing;
Line 10: import static org.mockito.Mockito.doReturn;


Line 91:     Map<Guid, List<Guid>> executedRemovedIds;
Line 92: 
Line 93:     Guid executedRemoveStoragePoolId;
Line 94: 
Line 95:     Guid executedRemoveStorageDomainId;
Done
Line 96: 
Line 97:     private final int ITEMS_COUNT_PER_UPDATE = 100;
Line 98: 
Line 99:     @Before


Line 144:         executedRemovedIds.put(pool3.getId(), new LinkedList<Guid>());
Line 145: 
Line 146:         executedUpdatedOvfGenerationIdsInDb.put(pool1.getId(), new 
HashMap<Guid, Long>());
Line 147:         executedUpdatedOvfGenerationIdsInDb.put(pool2.getId(), new 
HashMap<Guid, Long>());
Line 148:         executedUpdatedOvfGenerationIdsInDb.put(pool3.getId(), new 
HashMap<Guid, Long>());
Done
Line 149:     }
Line 150: 
Line 151: 
Line 152:     private void mockAnswers() {


Line 156:                 VM vm = (VM) invocation.getArguments()[0];
Line 157:                 return vm.getId().toString();
Line 158:             }
Line 159: 
Line 160:         }).when(updater).generateVmMetadata(any(VM.class), 
any(ArrayList.class));
should be arraylist
Line 161: 
Line 162:         doAnswer(new Answer<String>() {
Line 163:             @Override
Line 164:             public String answer(InvocationOnMock invocation) throws 
Throwable {


Line 178:                 }
Line 179:                 return toReturn;
Line 180:             }
Line 181: 
Line 182:         }).when(vmDAO).getVmsByIds(any(List.class));
Done
Line 183: 
Line 184:         doAnswer(new Answer<List<VmTemplate>>() {
Line 185:             @Override
Line 186:             public List<VmTemplate> answer(InvocationOnMock 
invocation) throws Throwable {


Line 205:                 assertTrue("too many ovfs were sent in one vdsm 
call", updateMap.size() <= ITEMS_COUNT_PER_UPDATE);
Line 206:                 return true;
Line 207:             }
Line 208: 
Line 209:         }).when(updater).executeUpdateVmInSpmCommand(any(Guid.class), 
any(Map.class), any(Guid.class));
Done
Line 210: 
Line 211:         doAnswer(new Answer<Boolean>() {
Line 212:             @Override
Line 213:             public Boolean answer(InvocationOnMock invocation) throws 
Throwable {


Line 232:                         "list with the new ovf values", 
values.size(), ids.size());
Line 233:                 Guid[] ids_array = ids.toArray(new Guid[ids.size()]);
Line 234:                 Long[] values_array = values.toArray(new 
Long[values.size()]);
Line 235:                 for (int i = 0; i < ids_array.length; i++)
Line 236:                 {
Done
Line 237:                     
executedUpdatedOvfGenerationIdsInDb.get(executedUpdateStoragePoolId).put(ids_array[i],
 values_array[i]);
Line 238:                 }
Line 239:                 return null;
Line 240:             }


Line 238:                 }
Line 239:                 return null;
Line 240:             }
Line 241: 
Line 242:         
}).when(vmAndTemplatesGenerationsDAO).updateOvfGenerations(any(List.class), 
any(List.class));
Done
Line 243:     }
Line 244: 
Line 245:     public List<storage_pool> createStoragePools() {
Line 246:         List<storage_pool> pools = new LinkedList<storage_pool>();


Line 586: 
Line 587:         initTestForPool(pool1.getId(), vmGuids, templatesGuids, 
removedGuids);
Line 588: 
Line 589:         updater.ovfUpdate_timer();
Line 590:         verify(updater, never()).performOvfUpdate(any(Guid.class), 
any(Map.class));
Done
Line 591:         verify(updater, 
times(size)).executeRemoveVmInSpm(any(Guid.class), any(Guid.class), 
any(Guid.class));
Line 592:         verifyCorrectOvfDataUpdaterRun(pool1.getId(), 
Collections.<Guid> emptyList(), removedGuids);
Line 593:     }
Line 594: 


Line 615:         updater.ovfUpdate_timer();
Line 616: 
Line 617:         List<Guid> neededToBeUpdated = new 
LinkedList<Guid>(vmGuidsUnlocked);
Line 618:         neededToBeUpdated.addAll(templatesGuidsUnlocked);
Line 619:         verify(updater, times(numberOfTimesToBeCalled(size, 
true))).performOvfUpdate(any(Guid.class), any(Map.class));
Done
Line 620:         verify(updater, 
times(size)).executeRemoveVmInSpm(any(Guid.class), any(Guid.class), 
any(Guid.class));
Line 621:         verifyCorrectOvfDataUpdaterRun(pool1.getId(), 
neededToBeUpdated, removedGuids);
Line 622:     }
Line 623: 


Line 635:         
doReturn(2L).when(vmStaticDAO).getDbGeneration(any(Guid.class));
Line 636: 
Line 637:         updater.ovfUpdate_timer();
Line 638: 
Line 639:         verify(updater, never()).performOvfUpdate(any(Guid.class), 
any(Map.class));
Done
Line 640:         verify(updater, 
never()).executeRemoveVmInSpm(any(Guid.class), any(Guid.class), 
any(Guid.class));
Line 641: 
Line 642:         List<Guid> idsThatNeededToBeUpdated = new 
LinkedList<Guid>(vmGuids);
Line 643:         idsThatNeededToBeUpdated.addAll(templatesGuids);


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java
Line 112:     @Column(name = "is_delete_protected")
Line 113:     private boolean deleteProtected;
Line 114: 
Line 115:     @Column(name = "db_generation")
Line 116:     private Long db_generation;
Done
Line 117: 
Line 118:     @Column(name = "is_smartcard_enabled")
Line 119:     private boolean smartcardEnabled;
Line 120: 


Line 229:         this.deleteProtected = deleteProtected;
Line 230:         setQuotaId(quotaId);
Line 231:     }
Line 232: 
Line 233:     public Long getDb_generation() {
Done
Line 234:         return db_generation;
Line 235:     }
Line 236: 
Line 237:     public void setDb_generation(Long db_generation) {


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java
Line 946:     public void setNiceLevel(int value) {
Line 947:         this.vmStatic.setnice_level(value);
Line 948:     }
Line 949: 
Line 950:     public void setDb_generation(long value) {
Done
Line 951:         this.vmStatic.setDb_generation(value);
Line 952:     }
Line 953: 
Line 954:     public Long getDb_generation() {


Line 950:     public void setDb_generation(long value) {
Line 951:         this.vmStatic.setDb_generation(value);
Line 952:     }
Line 953: 
Line 954:     public Long getDb_generation() {
Done
Line 955:         return vmStatic.getDb_generation();
Line 956:     }
Line 957: 
Line 958:     public MigrationSupport getMigrationSupport() {


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
Line 824:     @DefaultValueAttribute("60")
Line 825:     WaitForVdsInitInSec(230),
Line 826: 
Line 827:     @TypeConverterAttribute(Integer.class)
Line 828:     @DefaultValueAttribute("1")
Done
Line 829:     OvfUpdateIntervalInMinutes(231),
Line 830: 
Line 831:     @TypeConverterAttribute(Integer.class)
Line 832:     @DefaultValueAttribute("100")


Line 825:     WaitForVdsInitInSec(230),
Line 826: 
Line 827:     @TypeConverterAttribute(Integer.class)
Line 828:     @DefaultValueAttribute("1")
Line 829:     OvfUpdateIntervalInMinutes(231),
Done
Line 830: 
Line 831:     @TypeConverterAttribute(Integer.class)
Line 832:     @DefaultValueAttribute("100")
Line 833:     OvfItemsCountPerUpdate(232),


Line 829:     OvfUpdateIntervalInMinutes(231),
Line 830: 
Line 831:     @TypeConverterAttribute(Integer.class)
Line 832:     @DefaultValueAttribute("100")
Line 833:     OvfItemsCountPerUpdate(232),
Done
Line 834: 
Line 835:     // JTODO - temporarily using values from 256 for Java specific 
options
Line 836:     @TypeConverterAttribute(String.class)
Line 837:     @DefaultValueAttribute("keys/engine.p12")


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/vdscommands/UpdateVMVDSCommandParameters.java
Line 3: import org.ovirt.engine.core.compat.*;
Line 4: 
Line 5: import java.util.List;
Line 6: import java.util.HashMap;
Line 7: import java.util.Map;
agreed, might be separated
Line 8: 
Line 9: public class UpdateVMVDSCommandParameters extends 
StorageDomainIdParametersBase {
Line 10:     public UpdateVMVDSCommandParameters(Guid storagePoolId,
Line 11:             Map<Guid, KeyValuePairCompat<String, List<Guid>>> 
infoDictionary) {


Line 4: 
Line 5: import java.util.List;
Line 6: import java.util.HashMap;
Line 7: import java.util.Map;
Line 8: 
relevant, as i use it from ovf data updater.
Line 9: public class UpdateVMVDSCommandParameters extends 
StorageDomainIdParametersBase {
Line 10:     public UpdateVMVDSCommandParameters(Guid storagePoolId,
Line 11:             Map<Guid, KeyValuePairCompat<String, List<Guid>>> 
infoDictionary) {
Line 12:         super(storagePoolId);


....................................................
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/StoragePoolDAODbFacadeImpl.java
Line 192:                 return entity;
Line 193:             }
Line 194:         };
Line 195: 
Line 196:         return getCallsHandler().executeReadList("GetAllByStatus", 
mapper, parameterSource);
I raised this issue before in this patch series,  I wanted to change it all in 
a further patch (this is copy -paste ) but if you want I don't mind adding this 
specific mapper as static here and change other methods to use it as well in 
further patch.
Line 197:     }
Line 198: 
Line 199:     @Override
Line 200:     public List<storage_pool> getAll(Guid userID, boolean isFiltered) 
{


....................................................
File 
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VdsDynamicDAOTest.java
Line 11: import org.ovirt.engine.core.compat.Guid;
Line 12: import org.ovirt.engine.core.compat.NGuid;
Line 13: 
Line 14: public class VdsDynamicDAOTest extends BaseDAOTestCase {
Line 15:     private static final Guid EXISTING_VDS_ID = new 
Guid("2001751e-549b-4e7a-aff6-32d36856c125");
Done
Line 16:     private VdsDynamicDAO dao;
Line 17:     private VdsStaticDAO staticDao;
Line 18:     private VdsStatisticsDAO statisticsDao;
Line 19:     private VdsStatic existingVds;


....................................................
File 
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VdsStaticDAOTest.java
Line 15: import org.ovirt.engine.core.compat.NGuid;
Line 16: 
Line 17: 
Line 18: public class VdsStaticDAOTest extends BaseDAOTestCase {
Line 19:     private static final Guid EXISTING_VDS_ID = new 
Guid("2001751e-549b-4e7a-aff6-32d36856c125");
Done
Line 20:     private static final String IP_ADDRESS = "192.168.122.17";
Line 21:     private VdsStaticDAO dao;
Line 22:     private VdsDynamicDAO dynamicDao;
Line 23:     private VdsStatisticsDAO statisticsDao;


....................................................
File 
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VdsStatisticsDAOTest.java
Line 9: import org.ovirt.engine.core.compat.Guid;
Line 10: import org.ovirt.engine.core.compat.NGuid;
Line 11: 
Line 12: public class VdsStatisticsDAOTest extends BaseDAOTestCase {
Line 13:     private static final Guid EXISTING_VDS_ID = new 
Guid("2001751e-549b-4e7a-aff6-32d36856c125");
Done
Line 14:     private VdsStatisticsDAO dao;
Line 15:     private VdsStaticDAO staticDao;
Line 16:     private VdsDynamicDAO dynamicDao;
Line 17:     private VdsStatic existingVds;


....................................................
File 
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmAndTemplatesGenerationsDaoTest.java
Line 1: package org.ovirt.engine.core.dao;
Line 2: 
Line 3: import static org.junit.Assert.*;
Done
Line 4: 
Line 5: import java.util.Collections;
Line 6: import java.util.LinkedList;
Line 7: import java.util.List;


....................................................
File backend/manager/modules/dal/src/test/resources/fixtures.xml
Line 847:             <value>2010-12-01 09:52:57</value>
Line 848:             <value>4</value>
Line 849:         </row>
Line 850:     </table>
Line 851:     
Done
Line 852:     <table name="vm_ovf_generations">
Line 853:         <column>vm_guid</column>
Line 854:         <column>storage_pool_id</column>
Line 855:         <column>ovf_generation</column>


....................................................
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/irsbroker/RemoveVMVDSCommand.java
Line 1: package org.ovirt.engine.core.vdsbroker.irsbroker;
Line 2: 
Line 3: import org.ovirt.engine.core.compat.*;
Done
Line 4: import org.ovirt.engine.core.common.errors.VdcBllErrors;
Line 5: import org.ovirt.engine.core.common.vdscommands.*;
Line 6: import org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase;
Line 7: 


....................................................
Commit Message
Line 11: abillity to run VMs without having a running engine/db. Currently OVF
Line 12: update is done synchronously when performing various operations on
Line 13: VMs/templates - update, save, adding/removing a disk, etc. What's more,
Line 14: currently updating the OVF (updateVM vdsm call) is usually done within 
a
Line 15: transcation.
Done
Line 16: 
Line 17: The idea behined OvfAutoUpdater is to perform a batch OVF update
Line 18: operations that aggregate all pending updates per data center. These
Line 19: updates will be done in specified time intervals which will reduce


Line 13: VMs/templates - update, save, adding/removing a disk, etc. What's more,
Line 14: currently updating the OVF (updateVM vdsm call) is usually done within 
a
Line 15: transcation.
Line 16: 
Line 17: The idea behined OvfAutoUpdater is to perform a batch OVF update
Done
Line 18: operations that aggregate all pending updates per data center. These
Line 19: updates will be done in specified time intervals which will reduce
Line 20: XML-RPC calls and will enable the removal of this syncronous vdsm call
Line 21: from all over the code.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9b5132300fb1f1fd94f771cab15efe5246dbeca8
Gerrit-PatchSet: 18
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Aravot <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Arik Hadas <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Michael Kublin <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: Vered Volansky <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: liron aravot <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to