[Kimchi-devel] [PATCH V3 0/3] Edit guest MAC address

Aline Manera alinefm at linux.vnet.ibm.com
Wed May 27 16:50:11 UTC 2015


When I tried to update the MAC address in a *running* guest I got the 
following error on console and no details on UI:

Request Headers:
   COOKIE: kimchi=e80c44db2648eb64913d2536ad141ab5873bb358; 
username=alinefm; 
roles=%7B%22templates%22%3A%22admin%22%2C%22host%22%3A%22admin%22%2C%22storage%22%3A%22admin%22%2C%22guests%22%3A%22admin%22%2C%22network%22%3A%22admin%22%7D; 
lastPage="/#tabs/guests"
   Remote-Addr: 127.0.0.1
   X-REAL-IP: 127.0.0.1
   Content-Length: 60
   USER-AGENT: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:38.0) 
Gecko/20100101 Firefox/38.0
   CONNECTION: close
   REFERER: https://localhost:8001/
   X-REQUESTED-WITH: XMLHttpRequest
   HOST: localhost
   ACCEPT: application/json, text/javascript, */*; q=0.01
   ACCEPT-LANGUAGE: en-US,en;q=0.5
   X-FORWARDED-FOR: 127.0.0.1
   Content-Type: application/json; charset=UTF-8
   ACCEPT-ENCODING: gzip, deflate
[27/May/2015:13:46:26] HTTP Traceback (most recent call last):
   File "/usr/lib/python2.7/dist-packages/cherrypy/_cprequest.py", line 
670, in respond
     response.body = self.handler()
   File "/usr/lib/python2.7/dist-packages/cherrypy/lib/encoding.py", 
line 217, in __call__
     self.body = self.oldhandler(*args, **kwargs)
   File "/usr/lib/python2.7/dist-packages/cherrypy/_cpdispatch.py", line 
61, in __call__
     return self.callable(*self.args, **self.kwargs)
   File "/home/alinefm/kimchi/src/kimchi/control/base.py", line 170, in 
index
     'PUT': self.update}[method](*args, **kargs)
   File "/home/alinefm/kimchi/src/kimchi/control/base.py", line 209, in 
update
     ident = update(*args)
   File "/home/alinefm/kimchi/src/kimchi/model/vmifaces.py", line 174, 
in update
     dom.detachDeviceFlags(xml, flags=flags)
   File "/home/alinefm/kimchi/src/kimchi/model/libvirtconnection.py", 
line 66, in wrapper
     ret = f(*args, **kwargs)
   File "/usr/lib/python2.7/dist-packages/libvirt.py", line 1091, in 
detachDeviceFlags
     if ret == -1: raise libvirtError ('virDomainDetachDeviceFlags() 
failed', dom=self)
libvirtError: operation failed: no device matching mac address 
52:54:00:10:8d:f7 found on 0000:00:0c.0

If it not possible to edit the MAC address for a running guest, we 
should properly check the guest state and raise an exception and also 
get the edit action disabled on UI.



On 27/05/2015 09:36, Jose Ricardo Ziviani wrote:
> V3:
>   - Updated API.json to filter mac address.
>   - Improved UI code.
>
> V2:
>   - Updated API.json to reflect only mac address as required parameter.
>   - Removed input text filters.
>   - Updated error message.
>
> This patchset implements a new feature in Kimchi, it allows users to view and/or edit a guest MAC address.
>
> I have a fork of kimchi in my github, so if you prefer to use their diff tool (syntax highlight) you can check this link out:
> https://github.com/kimchi-project/kimchi/compare/master...jrziviani:guest_mac
>
> Jose Ricardo Ziviani (3):
>    Implement backend code to edit MAC address of a guest
>    Implement frontend code to edit MAC address of a guest
>    Update test cases to reflect MAC address update changes
>
>   src/kimchi/API.json                 | 22 ++++++++---------
>   src/kimchi/i18n.py                  |  4 +++-
>   src/kimchi/model/vmifaces.py        | 47 +++++++++++++++++++++++--------------
>   tests/test_model.py                 | 17 +++++++++++---
>   tests/test_rest.py                  | 12 ++++++----
>   ui/js/src/kimchi.guest_edit_main.js | 44 +++++++++++++++++++++++-----------
>   ui/pages/guest-edit.html.tmpl       |  6 +++--
>   7 files changed, 99 insertions(+), 53 deletions(-)
>




More information about the Kimchi-devel mailing list