Don't change list to tuple when get info from libvirt

Bug #1291805 reported by Shuangtai Tian
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Medium
Shuangtai Tian
OpenStack Compute (nova)
Fix Released
Medium
Shuangtai Tian

Bug Description

In the libvirt.driver, we now use the code like this:
(state, _max_mem, _mem, _cpus, _t) = virt_dom.info()

if the libvirt add new variables in the domain info, the code will be failed.
the error will like this :
 File "/opt/stack/nova/nova/service.py", line 180, in start
    self.manager.init_host()
  File "/opt/stack/nova/nova/compute/manager.py", line 974, in init_host
    self._init_instance(context, instance)
  File "/opt/stack/nova/nova/compute/manager.py", line 882, in _init_instance
    drv_state = self._get_power_state(context, instance)
  File "/opt/stack/nova/nova/compute/manager.py", line 990, in _get_power_state
    return self.driver.get_info(instance)["state"]
  File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 3462, in get_info
    (state, max_mem, mem, num_cpu, cpu_time) = virt_dom.info()
ValueError: too many values to unpack

Tags: libvirt
Changed in nova:
assignee: nobody → Shuangtai Tian (shuangtai-tian)
Changed in ceilometer:
assignee: nobody → Shuangtai Tian (shuangtai-tian)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/80184

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

Fix proposed to branch: master
Review: https://review.openstack.org/80192

Changed in ceilometer:
status: New → In Progress
Revision history for this message
Sean Dague (sdague) wrote :

This requires upstream (unreleased) libvirt to trigger, so setting to medium

Changed in nova:
importance: Undecided → Medium
Revision history for this message
Daniel Berrange (berrange) wrote :

I don't believe there is any bug here. Libvirt will *never* add new fields to existing C structs, since that would break ABI compatibility, so by implication the getInfo() list will not get extra elements.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/80184
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=8fa190c0d4ede0acc8ed4a462a5ebb751380143c
Submitter: Jenkins
Branch: master

commit 8fa190c0d4ede0acc8ed4a462a5ebb751380143c
Author: Shuangtai Tian <email address hidden>
Date: Thu Mar 13 14:13:54 2014 +0800

    Use the list when get information from libvirt

    If the libvirt adds new elements to the domain info struct or others,
    when use the new libvirt, there will be a valueError (too many values
    to unpack). When we get information from libvirt, we should use the
    original variable format. This change is for compatibility with upcoming
    versions of libvirt which change this signature.

    Change-Id: I0271a260a53fe8f5fc17b2934ebe3a3c9ee0c130
    Closes-Bug: #1291805

Changed in nova:
status: In Progress → Fix Committed
tags: added: libvirt
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/80192
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=0b3fa781b82246b5410f5e3520c0d9e50ef2bc1f
Submitter: Jenkins
Branch: master

commit 0b3fa781b82246b5410f5e3520c0d9e50ef2bc1f
Author: Shuangtai Tian <email address hidden>
Date: Thu Mar 13 14:30:14 2014 +0800

    Use the list when get information from libvirt

    If the libvirt adds new elements to the domain info struct or others,
    when use the new libvirt, there will be a valueError (too many values
    to unpack). When we get information from libvirt, we should use the
    original variable format. This change is for compatibility with upcoming
    versions of libvirt which change this signature.

    Change-Id: I885a48b730acd618e7cefc93cee3d69226575b7c
    Closes-Bug: #1291805

Changed in ceilometer:
status: In Progress → Fix Committed
gordon chung (chungg)
Changed in ceilometer:
importance: Undecided → Medium
Eoghan Glynn (eglynn)
Changed in ceilometer:
milestone: none → juno-1
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-1 → 2014.2
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: juno-1 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.