[virt-tools-list] [PATCH 0/2] Show IP address in virt-manager
Michal Privoznik
mprivozn at redhat.com
Mon Mar 5 09:53:23 UTC 2018
On 03/02/2018 03:58 PM, Dylan Stephano-Shachter wrote:
> That is interesting. Could you possibly run virt-manager with --debug and
> send me any stacktraces you see?
[Please don't top post on technical lists.]
>
> On Mar 2, 2018 7:55 AM, "Michal Privoznik" <mprivozn at redhat.com> wrote:
>
>> On 03/02/2018 07:27 AM, Dylan Stephano-Shachter wrote:
>>> I have added a feature to show a VM's first IP address next to the VM
>> state (Running, etc.). This feature can be toggled in the preferences menu
>> and is disabled by default. It uses the qemu-guest agent to query the IP
>> address.
>>>
>>> Dylan Stephano-Shachter (2):
>>> show the first ip address of running vms
>>> add preferences option to enable 'show first ip'
>>>
>>> data/org.virt-manager.virt-manager.gschema.xml | 6 ++++++
>>> ui/preferences.ui | 15 +++++++++++++++
>>> virtManager/config.py | 8 ++++++++
>>> virtManager/domain.py | 16 ++++++++++++++++
>>> virtManager/engine.py | 7 +++++++
>>> virtManager/manager.py | 19 +++++++++++++++----
>>> virtManager/preferences.py | 9 +++++++++
>>> 7 files changed, 76 insertions(+), 4 deletions(-)
>>>
>>
>> Interestingly, this made a machine I have not to be displayed in the
>> list of domains. The domain is running, qemu-ga is installed and running
>> and domain has an IP address:
>>
>>
>> virsh # domifaddr fedora --source agent
>> Name MAC address Protocol Address
>> ------------------------------------------------------------
>> -------------------
>> lo 00:00:00:00:00:00 ipv4 127.0.0.1/8
>> - - ipv6 ::1/128
>> ens3 52:54:00:a4:6f:91 ipv4 192.168.122.37/24
>> - - ipv6 fe80::ee48:d373:fc65:fce0/64
>> virbr0 52:54:00:1f:be:17 ipv4 192.168.124.1/24
>> virbr0-nic 52:54:00:1f:be:17 N/A N/A
I've managed to reproduce and here's the interesting part of the debug output:
[Mon, 05 Mar 2018 10:50:43 virt-manager 12584] DEBUG (connection:1197) domain=fedora status=Running added
[Mon, 05 Mar 2018 10:50:43 virt-manager 12584] DEBUG (cli:258) Uncaught exception:
Traceback (most recent call last):
File "/home/zippy/work/virt-manager.git/virtManager/manager.py", line 600, in vm_added
row = self._build_row(None, vm)
File "/home/zippy/work/virt-manager.git/virtManager/manager.py", line 671, in _build_row
ipaddr = vm.get_first_ip_addr()
File "/home/zippy/work/virt-manager.git/virtManager/domain.py", line 1093, in get_first_ip_addr
if iface != 'lo' and IP_REGEX.match(ifaces[iface]['addrs'][0]['addr']):
TypeError: 'NoneType' object is not subscriptable
Traceback (most recent call last):
File "/home/zippy/work/virt-manager.git/virtManager/manager.py", line 600, in vm_added
row = self._build_row(None, vm)
File "/home/zippy/work/virt-manager.git/virtManager/manager.py", line 671, in _build_row
ipaddr = vm.get_first_ip_addr()
File "/home/zippy/work/virt-manager.git/virtManager/domain.py", line 1093, in get_first_ip_addr
if iface != 'lo' and IP_REGEX.match(ifaces[iface]['addrs'][0]['addr']):
TypeError: 'NoneType' object is not subscriptable
Michal
More information about the virt-tools-list
mailing list