Juan Hernandez has posted comments on this change. Change subject: restapi: added support for ksm control ......................................................................
Patch Set 2: (6 comments) This is the correct way to add a new boolean property. But I think it is better if we reuse the existing "KSM" complex type that we currently use for hosts. http://gerrit.ovirt.org/#/c/23359/2/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd File backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd: Line 1269: <xs:element name="trusted_service" type="xs:boolean" minOccurs="0" maxOccurs="1"/> Line 1270: <xs:element name="ha_reservation" type="xs:boolean" minOccurs="0" maxOccurs="1"/> Line 1271: <xs:element name="ballooning_enabled" type="xs:boolean" minOccurs="0" maxOccurs="1"/> Line 1272: <xs:element ref="display" minOccurs="0" maxOccurs="1"/> Line 1273: <xs:element name="ksm_enabled" type="xs:boolean" minOccurs="0" maxOccurs="1"/> We already have a "ksm" element with a nested "enabled" element for hosts. Please reuse it here: <xs:element ref="ksm" minOccurs="0" maxOccurs="1"/> Line 1274: <!-- Also a rel="networks" link --> Line 1275: </xs:sequence> Line 1276: </xs:extension> Line 1277: </xs:complexContent> http://gerrit.ovirt.org/#/c/23359/2/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml File backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml: Line 1560: optionalArguments: {cluster.name: 'xs:string', cluster.description: 'xs:string', cluster.comment: 'xs:string', cluster.data_center.id: 'xs:string', cluster.cpu.id: 'xs:string', cluster.version.major: 'xs:int', cluster.version.minor: 'xs:int', Line 1561: cluster.memory_policy.overcommit.percent: 'xs:double', cluster.memory_policy.transparent_hugepages.enabled: 'xs:boolean', cluster.scheduling_policy.policy: 'xs:string', Line 1562: cluster.scheduling_policy.thresholds.low: 'xs:int', cluster.scheduling_policy.thresholds.high: 'xs:int', cluster.scheduling_policy.thresholds.duration: 'xs:int', Line 1563: cluster.error_handling.on_error: 'xs:string', cluster.virt_service: 'xs:boolean', cluster.gluster_service: 'xs:boolean', cluster.threads_as_cores: 'xs:boolean', cluster.tunnel_migration: 'xs:boolean', cluster.ballooning_enabled: 'xs:boolean', Line 1564: cluster.cpu.architecture: 'xs:string', cluster.display.proxy: 'xs:string', cluster.ksm_enabled: 'xs:boolean'} If you reuse the existing KSM element then this should be: cluster.ksm.enabled: 'xs:boolean' Line 1565: description: update the specified cluster in the system. The capabilities like virt service, cluster service, tarnsparent huge pages etc can be changed. Line 1566: urlparams: {} Line 1567: headers: Line 1568: Content-Type: {value: application/xml|json, required: true} Line 1577: optionalArguments: {cluster.description: 'xs:string', cluster.comment: 'xs:string', cluster.memory_policy.overcommit.percent: 'xs:double', cluster.memory_policy.transparent_hugepages.enabled: 'xs:boolean', Line 1578: cluster.scheduling_policy.policy: 'xs:string', cluster.scheduling_policy.thresholds.low: 'xs:int', cluster.scheduling_policy.thresholds.high: 'xs:int', Line 1579: cluster.scheduling_policy.thresholds.duration: 'xs:int', cluster.error_handling.on_error: 'xs:string', cluster.virt_service: 'xs:boolean', cluster.gluster_service: 'xs:boolean', cluster.threads_as_cores: 'xs:boolean', Line 1580: cluster.tunnel_migration: 'xs:boolean', cluster.trusted_service: 'xs:boolean', cluster.ha_reservation: 'xs:boolean', cluster.ballooning_enabled: 'xs:boolean', cluster.cpu.architecture: 'xs:string', cluster.display.proxy: 'xs:string', Line 1581: cluster.ksm_enabled: 'xs:boolean'} Same. Line 1582: description: add a new cluster to the system Line 1583: urlparams: {} Line 1584: headers: Line 1585: Content-Type: {value: application/xml|json, required: true} Line 1906: optionalArguments: {cluster.name: 'xs:string', cluster.description: 'xs:string', cluster.cpu.id: 'xs:string', cluster.version.major: 'xs:int', cluster.version.minor: 'xs:int', Line 1907: cluster.memory_policy.overcommit.percent: 'xs:double', cluster.memory_policy.transparent_hugepages.enabled: 'xs:boolean', cluster.scheduling_policy.policy: 'xs:string', Line 1908: cluster.scheduling_policy.thresholds.low: 'xs:int', cluster.scheduling_policy.thresholds.high: 'xs:int', cluster.scheduling_policy.thresholds.duration: 'xs:int', Line 1909: cluster.error_handling.on_error: 'xs:string', cluster.virt_service: 'xs:boolean', cluster.gluster_service: 'xs:boolean', cluster.threads_as_cores: 'xs:boolean', cluster.tunnel_migration: 'xs:boolean', cluster.trusted_service: 'xs:boolean', cluster.ha_reservation: 'xs:boolean', cluster.ballooning_enabled: 'xs:boolean', Line 1910: cluster.cpu.architecture: 'xs:string', cluster.display.proxy: 'xs:string', cluster.ksm_enabled: 'xs:boolean',} Same. Line 1911: description: update specified cluster in the data center Line 1912: urlparams: {} Line 1913: headers: Line 1914: Content-Type: {value: application/xml|json, required: true} Line 1922: - mandatoryArguments: {cluster.name: 'xs:string', cluster.version.major: 'xs:int', cluster.version.minor: 'xs:int', cluster.cpu.id: 'xs:string'} Line 1923: optionalArguments: {cluster.description: 'xs:string', cluster.memory_policy.overcommit.percent: 'xs:double', cluster.memory_policy.transparent_hugepages.enabled: 'xs:boolean', Line 1924: cluster.scheduling_policy.policy: 'xs:string', cluster.scheduling_policy.thresholds.low: 'xs:int', cluster.scheduling_policy.thresholds.high: 'xs:int', Line 1925: cluster.scheduling_policy.thresholds.duration: 'xs:int', cluster.error_handling.on_error: 'xs:string', cluster.virt_service: 'xs:boolean', cluster.gluster_service: 'xs:boolean', cluster.threads_as_cores: 'xs:boolean', Line 1926: cluster.tunnel_migration: 'xs:boolean', cluster.ballooning_enabled: 'xs:boolean', cluster.cpu.architecture: 'xs:string', cluster.display.proxy: 'xs:string', cluster.ksm_enabled: 'xs:boolean',} Same. Line 1927: description: add a new cluster to the data center Line 1928: urlparams: {} Line 1929: headers: Line 1930: Content-Type: {value: application/xml|json, required: true} http://gerrit.ovirt.org/#/c/23359/2/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/ClusterMapper.java File backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/ClusterMapper.java: Line 94: } Line 95: if (model.isSetBallooningEnabled()) { Line 96: entity.setEnableBallooning(model.isBallooningEnabled()); Line 97: } Line 98: if (model.isSetKsmEnabled()) { If you reuse the existing KSM element this should be: if (model.isSetKsm() && model.getKsm().isSetEnabled()) { entity.setEnableKsm(model.getKsm().isEnabled()); } Line 99: entity.setEnableKsm(model.isKsmEnabled()); Line 100: } Line 101: if (model.isSetDisplay() && model.getDisplay().isSetProxy()) { Line 102: entity.setSpiceProxy("".equals(model.getDisplay().getProxy()) ? null : model.getDisplay().getProxy()); -- To view, visit http://gerrit.ovirt.org/23359 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I44b992bd2bb69ff0d7996b029249a787dc266617 Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Jiří Moskovčák <[email protected]> Gerrit-Reviewer: Doron Fediuck <[email protected]> Gerrit-Reviewer: Jiří Moskovčák <[email protected]> Gerrit-Reviewer: Juan Hernandez <[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
