[Kimchi-devel] [PATCH 3/5] Implement backend code to edit MAC address of a guest

Crístian Deives cristiandeives at gmail.com
Tue May 12 13:50:04 UTC 2015


When I try to run the following command:

UPDATE /vms/<vm>/ifaces/<iface> {"mac": "foo"}

I get the error message:

KCHVMIF0008E: Specify MAC Address to update a virtual machine interface

Well, I guess I did.

That error message is triggered by the REST definition in 
src/kimchi/API.json which states that "type" and "network" are required 
(*). As I'm not providing them, that error message is shown. However, 
the description doesn't match the scenario and it totally confuses the 
user. I just knew I had to enter "type" and "network" because I looked 
at API.json, but the error message didn't help at all.

(*): This might be unrelated to this patch but I have to comment: why is 
"type": "network" required to update a network interface? why is 
"network": "<network>" required? I wish my UPDATE command above (which 
updates the MAC address only) would work, that is a valid request from a 
user's point of view. I don't want to change the network, I just want to 
change the MAC address. Also, I couldn't change the interface network as 
well. Why is the field "network" required? Why does it exist at all? I'm 
required to enter two useless parameters here :-(

(**) You don't need to address my complaints above for this patchset, 
just make sure the [broken?] existing behavior still works. I'm more 
concerned here about your change to the error message which doesn't help 
the user now - and it was helpful before.

On 11-05-2015 14:19, Jose Ricardo Ziviani wrote:
> Signed-off-by: Jose Ricardo Ziviani <joserz at linux.vnet.ibm.com>
> ---
>   src/kimchi/API.json          | 13 ++++++++++
>   src/kimchi/i18n.py           |  4 ++-
>   src/kimchi/model/vmifaces.py | 60 +++++++++++++++++++++++++++++++-------------
>   3 files changed, 59 insertions(+), 18 deletions(-)



More information about the Kimchi-devel mailing list