Bug 915042 - ovirt-engine-restapi : make cpu-mode enumerable values lower-case and add to /capabilities
Summary: ovirt-engine-restapi : make cpu-mode enumerable values lower-case and add to ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi
Version: unspecified
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: ---
: 3.2.0
Assignee: Laszlo Hornyak
QA Contact: Ido Begun
URL:
Whiteboard: sla
Depends On:
Blocks: 948448
TreeView+ depends on / blocked
 
Reported: 2013-02-24 11:15 UTC by Oded Ramraz
Modified: 2016-02-10 20:20 UTC (History)
9 users (show)

Fixed In Version: sf16
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
oVirt Team: SLA
Target Upstream Version:
Embargoed:
sgrinber: Triaged+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 12453 0 None None None Never
oVirt gerrit 14086 0 None None None Never

Description Oded Ramraz 2013-02-24 11:15:28 UTC
Description of problem:

 cpu-mode enumerable values should not be capitalized , it is true for both VM / Host objects . 
I would add those values to /capabilities link as well . 


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

cpu-mode                  : CUSTOM

Comment 1 Doron Fediuck 2013-02-24 15:45:19 UTC
Michael, will such a change will not be considered as an API change?

Comment 2 Michael Pasternak 2013-02-25 10:30:13 UTC
(In reply to comment #1)
> Michael, will such a change will not be considered as an API change?

indeed.

Comment 3 Doron Fediuck 2013-02-25 13:30:07 UTC
OK, so all .value() at enum should return enum.value.lowercase() in api.

Comment 4 Michael Pasternak 2013-03-24 15:57:07 UTC
(In reply to comment #0)
> Description of problem:
> 
>  cpu-mode enumerable values should not be capitalized , it is true for both
> VM / Host objects . 
> I would add those values to /capabilities link as well . 
> 
> 

oded,

i see that enum returned in lowercase, only issue is a lack of the
/capabilities documentation.

Comment 5 Michael Pasternak 2013-03-24 16:18:24 UTC
seems like bugzila has a bug and i can't remove the old "External Trackers"
and add new ones, so here they are:

http://gerrit.ovirt.org/#/c/13308/
http://gerrit.ovirt.org/#/c/13309/

Comment 6 Oded Ramraz 2013-04-14 12:11:30 UTC
Still see the CPU mode value in capitals in CLI :

[RHEVM shell (connected)]# show vm 90417bba-31e7-480d-b88b-6f0bc628f8bf  | grep cpu-mode
cpu-mode                   : CUSTOM


[RHEVM shell (connected)]# show host 6372a8f7-89e4-4100-86d0-3fc26199d145 | grep -i cpu-mode
cpu-mode                                  : CUSTOM


[RHEVM shell (connected)]# show cluster 300664d6-d0a6-4065-95ab-e1c43a484384 | grep -i cpu-mode
cpu-mode                                   : CUSTOM


SF13.1

Comment 8 Michael Pasternak 2013-04-17 10:30:03 UTC
(In reply to comment #6)
> Still see the CPU mode value in capitals in CLI :
> 
> [RHEVM shell (connected)]# show vm 90417bba-31e7-480d-b88b-6f0bc628f8bf  |
> grep cpu-mode
> cpu-mode                   : CUSTOM
> 
> 
> [RHEVM shell (connected)]# show host 6372a8f7-89e4-4100-86d0-3fc26199d145 |
> grep -i cpu-mode
> cpu-mode                                  : CUSTOM
> 
> 
> [RHEVM shell (connected)]# show cluster 300664d6-d0a6-4065-95ab-e1c43a484384
> | grep -i cpu-mode
> cpu-mode                                   : CUSTOM
> 
> 
> SF13.1

oded, are you sure your shell is pointing to the SF13.1? looking in the
code i see:

vm
==

if(entity.isUseHostCpuFlags()) {
            cpu.setMode(CpuMode.HOST_PASSTHROUGH.value());
        }

public enum CpuMode {

    CUSTOM,
    HOST_MODEL,
    HOST_PASSTHROUGH;

    public String value() {
        return name().toLowerCase();
    }

    public static CpuMode fromValue(String value) {
        try {
            return valueOf(value.toUpperCase());
        } catch (IllegalArgumentException e) {
            return null;
        }
    }

}

also i can't see any mapping code in the host for cpu-mode

Comment 10 Laszlo Hornyak 2013-04-17 10:50:44 UTC
Hi Michael,

I do not see where you commented that on the patch. Later you requested the code to be changed but never accepted the fix, I think I abandoned the patch.
I am working on something else now, please ask Doron to give me time for this.

Thx,
Laszlo

Comment 11 Michael Pasternak 2013-04-17 14:43:01 UTC
(In reply to comment #10)
> Hi Michael,
> 
> I do not see where you commented that on the patch. Later you requested the
> code to be changed but never accepted the fix, I think I abandoned the patch.
> I am working on something else now, please ask Doron to give me time for
> this.
> 
> Thx,
> Laszlo

Lazlo,

please revert your change to <xs:complexType name="CPU"> from http://gerrit.ovirt.org/#/c/9753/

Comment 12 Ido Begun 2013-05-26 14:54:56 UTC
OK - SF17.1

CPU modes are listed in /capabilities:
<cpu_modes>
  <cpu_mode>custom</cpu_mode>
  <cpu_mode>host_model</cpu_mode>
  <cpu_mode>host_passthrough</cpu_mode>
</cpu_modes>

Also, in CLI/API, listed values are displayed in lower case (if they are displayed; if cpu_mode=custom, then it's not displayed).

Comment 13 Itamar Heim 2013-06-11 08:45:41 UTC
3.2 has been released

Comment 14 Itamar Heim 2013-06-11 08:45:50 UTC
3.2 has been released

Comment 15 Itamar Heim 2013-06-11 08:45:50 UTC
3.2 has been released

Comment 16 Itamar Heim 2013-06-11 08:51:47 UTC
3.2 has been released

Comment 17 Itamar Heim 2013-06-11 09:22:43 UTC
3.2 has been released


Note You need to log in before you can comment on or make changes to this bug.