PCI-Passthrough : TypeError: pop() takes at most 1 argument (2 given

Bug #1383345 reported by Joe Talerico
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Baodong (Robert) Li
Juno
Fix Released
Undecided
Unassigned

Bug Description

Setting the below causes nova to fail.

# White list of PCI devices available to VMs. For example:
# pci_passthrough_whitelist = [{"vendor_id": "8086",
# "product_id": "0443"}] (multi valued)
#pci_passthrough_whitelist=
pci_passthrough_whitelist=[{"vendor_id":"8086","product_id":"10fb"}]

Fails with :
CRITICAL nova [-] TypeError: pop() takes at most 1 argument (2 given)
2014-10-17 15:28:59.968 7153 CRITICAL nova [-] TypeError: pop() takes at most 1 argument (2 given)
2014-10-17 15:28:59.968 7153 TRACE nova Traceback (most recent call last):
2014-10-17 15:28:59.968 7153 TRACE nova File "/usr/bin/nova-compute", line 10, in <module>
2014-10-17 15:28:59.968 7153 TRACE nova sys.exit(main())
2014-10-17 15:28:59.968 7153 TRACE nova File "/usr/lib/python2.7/site-packages/nova/cmd/compute.py", line 72, in main
2014-10-17 15:28:59.968 7153 TRACE nova db_allowed=CONF.conductor.use_local)
2014-10-17 15:28:59.968 7153 TRACE nova File "/usr/lib/python2.7/site-packages/nova/service.py", line 275, in create
2014-10-17 15:28:59.968 7153 TRACE nova db_allowed=db_allowed)
2014-10-17 15:28:59.968 7153 TRACE nova File "/usr/lib/python2.7/site-packages/nova/service.py", line 148, in __init__
2014-10-17 15:28:59.968 7153 TRACE nova self.manager = manager_class(host=self.host, *args, **kwargs)
2014-10-17 15:28:59.968 7153 TRACE nova File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 631, in __init__
2014-10-17 15:28:59.968 7153 TRACE nova self.driver = driver.load_compute_driver(self.virtapi, compute_driver)
2014-10-17 15:28:59.968 7153 TRACE nova File "/usr/lib/python2.7/site-packages/nova/virt/driver.py", line 1402, in load_compute_driver
2014-10-17 15:28:59.968 7153 TRACE nova virtapi)
2014-10-17 15:28:59.968 7153 TRACE nova File "/usr/lib/python2.7/site-packages/nova/openstack/common/importutils.py", line 50, in import_object_ns
2014-10-17 15:28:59.968 7153 TRACE nova return import_class(import_value)(*args, **kwargs)
2014-10-17 15:28:59.968 7153 TRACE nova File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 405, in __init__
2014-10-17 15:28:59.968 7153 TRACE nova self.dev_filter = pci_whitelist.get_pci_devices_filter()
2014-10-17 15:28:59.968 7153 TRACE nova File "/usr/lib/python2.7/site-packages/nova/pci/pci_whitelist.py", line 88, in get_pci_devices_filter
2014-10-17 15:28:59.968 7153 TRACE nova return PciHostDevicesWhiteList(CONF.pci_passthrough_whitelist)
2014-10-17 15:28:59.968 7153 TRACE nova File "/usr/lib/python2.7/site-packages/nova/pci/pci_whitelist.py", line 68, in __init__
2014-10-17 15:28:59.968 7153 TRACE nova self.specs = self._parse_white_list_from_config(whitelist_spec)
2014-10-17 15:28:59.968 7153 TRACE nova File "/usr/lib/python2.7/site-packages/nova/pci/pci_whitelist.py", line 49, in _parse_white_list_from_config
2014-10-17 15:28:59.968 7153 TRACE nova spec = pci_devspec.PciDeviceSpec(jsonspec)
2014-10-17 15:28:59.968 7153 TRACE nova File "/usr/lib/python2.7/site-packages/nova/pci/pci_devspec.py", line 132, in __init__
2014-10-17 15:28:59.968 7153 TRACE nova self._init_dev_details()
2014-10-17 15:28:59.968 7153 TRACE nova File "/usr/lib/python2.7/site-packages/nova/pci/pci_devspec.py", line 137, in _init_dev_details
2014-10-17 15:28:59.968 7153 TRACE nova self.vendor_id = details.pop("vendor_id", ANY)

Changing the config to:
pci_passthrough_whitelist={"vendor_id":"8086","product_id":"10fb"}

Fixes the above.

In Icehouse, PCI Passthrough worked with passing a list, in Juno it is broken.

Changed in nova:
assignee: nobody → Baodong (Robert) Li (baoli)
Changed in nova:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Baodong (Robert) Li (baoli) wrote :

as you have indicated that setting it as

            pci_passthrough_whitelist={"vendor_id":"8086","product_id":"10fb"}

will succeed, this is done in Juno to simplify it by not requiring the [ ] any more. The reason for that is pci whitelist is a multiline option, and each line specifies a single whitelist entry.

Revision history for this message
Joe Talerico (jtaleric) wrote :

Okay, so this is expected to change? since [] worked in icehouse...

Revision history for this message
Dan Smith (danms) wrote :

No, it's not expected. It is *required* that a config for release N-1 works in release N. That means a config from an icehouse deployment *must* work in a juno deployment without requiring any changes.

Revision history for this message
Baodong (Robert) Li (baoli) wrote :

Ok, got it, will work on the fix

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/130833

Changed in nova:
status: Confirmed → In Progress
tags: added: pci-passthrough
Changed in nova:
assignee: Baodong (Robert) Li (baoli) → Ian Wienand (iwienand)
Changed in nova:
assignee: Ian Wienand (iwienand) → Baodong (Robert) Li (baoli)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit bb7bfd313c9d4c052c85b4ad5ccd8361f5f3b004
Author: Robert Li <email address hidden>
Date: Fri Oct 24 14:41:09 2014 -0400

    Support both list and dict for pci_passthrough_whitelist

    In Icehouse, pci_passthrough_whitelist is a json docstring that
    encodes a list. In Juno, it is a json docstring that encodes
    a dict. This patch adds the list support back to
    pci_passthrough_whitelist, and both list and dict are now supported.

    Change-Id: I523cfb756a09c75e4f60015adadb3a1403298cd3
    Closes-Bug: 1383345

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → kilo-2
status: Fix Committed → Fix Released
tags: added: juno-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/170089

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

Reviewed: https://review.openstack.org/170089
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=c2ef829c09b1fffbd0004428025705fd44470df8
Submitter: Jenkins
Branch: stable/juno

commit c2ef829c09b1fffbd0004428025705fd44470df8
Author: Robert Li <email address hidden>
Date: Fri Oct 24 14:41:09 2014 -0400

    Support both list and dict for pci_passthrough_whitelist

    In Icehouse, pci_passthrough_whitelist is a json docstring that
    encodes a list. In Juno, it is a json docstring that encodes
    a dict. This patch adds the list support back to
    pci_passthrough_whitelist, and both list and dict are now supported.

    (cherry picked from commit bb7bfd313c9d4c052c85b4ad5ccd8361f5f3b004)

    Conflicts:
     nova/pci/pci_whitelist.py
     nova/tests/pci/test_pci_devspec.py
    Because juno imports module as pci_devspec since
    kilo as devspec.

    Closes-Bug: 1383345
    Change-Id: I523cfb756a09c75e4f60015adadb3a1403298cd3

tags: added: in-stable-juno
Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-2 → 2015.1.0
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.