detach_pci_devices failed

Bug #1318891 reported by Ding Xiao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Ding Xiao

Bug Description

when detach a pci device from instance

the method _detach_pci_devices will check if pci device detached

> for hdev in [d for d in guest_config.devices
> if d.type == 'pci']:

guest_config.devices will have more device not only pci, like disk

in LibvirtConfigGuestDisk has no attribute type

  File "/home/xiaoding/nova/nova/tests/virt/libvirt/test_libvirt.py", line 684, in test_detach_pci_devices
    conn._detach_pci_devices(FakeDomain(), pci_devices)
  File "/home/xiaoding/nova/nova/virt/libvirt/driver.py", line 2774, in _detach_pci_devices
    if d.type == 'pci']:
AttributeError: 'LibvirtConfigGuestDisk' object has no attribute 'type'

https://review.openstack.org/#/c/93383/

Tags: compute
Ding Xiao (xiaoding1)
Changed in nova:
assignee: nobody → Ding Xiao (xiaoding1)
Ding Xiao (xiaoding1)
description: updated
description: updated
Ding Xiao (xiaoding1)
description: updated
Changed in nova:
status: New → In Progress
Tracy Jones (tjones-i)
tags: added: compute
Changed in nova:
importance: Undecided → Medium
Ding Xiao (xiaoding1)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit c75cd9a8b9da86b9d9e7ffd6512fe13b1913fd85
Author: xiaoding <email address hidden>
Date: Thu Jun 12 15:39:51 2014 +0800

    Fix detaching pci device failed

    after booting an instance with flavor has pci device,
    and then resize the instance, it will raise an "AttributeError".
    this because in the method _detach_pci_devices(),
    guest_config.devices will have more device not only pci, like disk.

    Closes-bug: #1318891

    Change-Id: Id52883a4f1fa7d05d61b31674acd1ca57918c3e1

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → juno-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-2 → 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.