Moti Asayag has posted comments on this change. Change subject: core: Update VM devices on DB when hash changes ......................................................................
Patch Set 1: (4 inline comments) .................................................... File backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java Line 825: private XmlRpcStruct[] getVmInfo(List<String> vmsToUpdate) { You refers to the Vm device updates, but regardless the VM device, at this point there are some other pending updates to be save to DB for VM. But as I see, the update will be in any case in the finally block of the Refresh() method. In any case, I think it is worth to wrap this call with try-catch block and if failed to get the full vm device list from VDSM, to skip this VM, rather failing and rolling up. Line 892: DbFacade.getInstance().getVmDeviceDAO().remove(device.getId()); you can cache the list of device IDs to be deleted, and than perform deletion of those from SaveDataToDb(), perhaps worth in a single DB call. Line 915: specParams = ((Map<String, String>) o).toString(); perhaps writing your own expected format: Set<Entry<String, String>> entrySet = ((Map<String, String>) o).entrySet(); StringBuilder sb = new StringBuilder(); final String DELIMITER = ","; //maybe public static or reuse already defined SEP for (Entry<String, String> entry : entrySet) { if (sb.length() > 0) { sb.append(DELIMITER); } sb.append(entry.getKey()); sb.append(DELIMITER); sb.append(entry.getValue()); } specParams = sb.toString(); Line 924: DbFacade.getInstance().getVmDeviceDAO().save(newDevice); looks like a mass updates, that why i suggested you should cache the entities to be update and use that mass update. -- To view, visit http://gerrit.ovirt.org/2410 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia963db83d88cb11c57be197c40d64f1e1b3c88c9 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Eli Mesika <emes...@redhat.com> Gerrit-Reviewer: Eli Mesika <emes...@redhat.com> Gerrit-Reviewer: Michael Kublin <mkub...@redhat.com> Gerrit-Reviewer: Moti Asayag <masa...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches