← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1604332] [NEW] NoneType dereference in parsing guest device address

 

Public bug reported:

I tried to run tempest test on AArch64. It failed when creating a test
bed VM. The error log is attached below.

Traceback (most recent call last):
...... eliminated for clarity ......
File "/opt/stack/nova/nova/virt/libvirt/config.py", line 896, in parse_dom
AttributeError: 'NoneType' object has no attribute 'parse_dom'

Error comes from "nova/virt/libvirt/config.py".
https://review.openstack.org/gitweb?p=openstack/nova.git;a=blob;f=nova/virt/libvirt/config.py;h=281f42f72926c03a49b82182e8a1287e8cf9a1a7;hb=HEAD

In following code, the factory method may return None if address type is
neither 'pci' nor 'drive'. And the caller suffer from NoneType
dereference. As AArch64 default using 'virtio-mmio' for disk type, this
bug is triggered.

1142 class LibvirtConfigGuestDeviceAddress(LibvirtConfigObject):
1143     def __init__(self, type=None, **kwargs):
1144         super(LibvirtConfigGuestDeviceAddress, self).__init__(
1145             root_name='address', **kwargs)
1146         self.type = type
1147 
1148     @staticmethod
1149     def factory(xmldoc):
1150         addr_type = xmldoc.get('type')
1151         if addr_type == 'pci':
1152             return LibvirtConfigGuestDeviceAddressPCI()
1153         elif addr_type == 'drive':
1154             return LibvirtConfigGuestDeviceAddressDrive()
-----------> return None implicitly here

** Affects: nova
     Importance: Undecided
     Assignee: Yibo Cai (cyb70289)
         Status: In Progress

** Changed in: nova
     Assignee: (unassigned) => Yibo Cai (cyb70289)

** Changed in: nova
       Status: New => In Progress

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1604332

Title:
  NoneType dereference in parsing guest device address

Status in OpenStack Compute (nova):
  In Progress

Bug description:
  I tried to run tempest test on AArch64. It failed when creating a test
  bed VM. The error log is attached below.

  Traceback (most recent call last):
  ...... eliminated for clarity ......
  File "/opt/stack/nova/nova/virt/libvirt/config.py", line 896, in parse_dom
  AttributeError: 'NoneType' object has no attribute 'parse_dom'

  Error comes from "nova/virt/libvirt/config.py".
  https://review.openstack.org/gitweb?p=openstack/nova.git;a=blob;f=nova/virt/libvirt/config.py;h=281f42f72926c03a49b82182e8a1287e8cf9a1a7;hb=HEAD

  In following code, the factory method may return None if address type
  is neither 'pci' nor 'drive'. And the caller suffer from NoneType
  dereference. As AArch64 default using 'virtio-mmio' for disk type,
  this bug is triggered.

  1142 class LibvirtConfigGuestDeviceAddress(LibvirtConfigObject):
  1143     def __init__(self, type=None, **kwargs):
  1144         super(LibvirtConfigGuestDeviceAddress, self).__init__(
  1145             root_name='address', **kwargs)
  1146         self.type = type
  1147 
  1148     @staticmethod
  1149     def factory(xmldoc):
  1150         addr_type = xmldoc.get('type')
  1151         if addr_type == 'pci':
  1152             return LibvirtConfigGuestDeviceAddressPCI()
  1153         elif addr_type == 'drive':
  1154             return LibvirtConfigGuestDeviceAddressDrive()
  -----------> return None implicitly here

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1604332/+subscriptions


Follow ups