NoneType is returned from libvirt while get_vcpu_used
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
In Progress
|
Undecided
|
wangpan |
Bug Description
166825 2014-03-19 14:44:46.132 43907 TRACE nova.openstack.
166826 2014-03-19 14:44:46.132 43907 TRACE nova.openstack.
166827 2014-03-19 14:44:46.132 43907 TRACE nova.openstack.
166828 2014-03-19 14:44:46.132 43907 TRACE nova.openstack.
166829 2014-03-19 14:44:46.132 43907 TRACE nova.openstack.
166830 2014-03-19 14:44:46.132 43907 TRACE nova.openstack.
166831 2014-03-19 14:44:46.132 43907 TRACE nova.openstack.
166832 2014-03-19 14:44:46.132 43907 TRACE nova.openstack.
166833 2014-03-19 14:44:46.132 43907 TRACE nova.openstack.
166834 2014-03-19 14:44:46.132 43907 TRACE nova.openstack.
this bug is because of my commit as below,
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: master
commit 844df860c38ac38
Author: Wangpan <email address hidden>
Date: Fri Jan 17 10:35:12 2014 +0800
libvirt: handle exception while get vcpu info
If an exception is raised while get a libvirt domain's vcpu info,
the update_
will result in the resource of this compute node will never be
reported.
This patch add an exception handling to avoid this situation.
Closes-bug: #1270008
the checking of return value is None was removed, but old python-libvirt(e.g. 0.9.x) only raise libvirtError while the libvirt api return -1, and the old libvirt return None rather than -1 while get vcpu info failed, please see the libvirt codes below:
python/
static PyObject *
libvirt_
virDomainPtr domain;
PyObject *pyobj_domain, *pyretval = NULL, *pycpuinfo = NULL, *pycpumap = NULL;
virNodeInfo nodeinfo;
virDomainInfo dominfo;
virVcpuInfoPtr cpuinfo = NULL;
unsigned char *cpumap = NULL;
size_t cpumaplen, i;
int i_retval;
if (!PyArg_
return NULL;
domain = (virDomainPtr) PyvirDomain_
LIBVIRT_
i_retval = virNodeGetInfo(
LIBVIRT_
if (i_retval < 0)
return VIR_PY_NONE;
LIBVIRT_
i_retval = virDomainGetInf
LIBVIRT_
if (i_retval < 0)
return VIR_PY_NONE;
if (VIR_ALLOC_
return VIR_PY_NONE;
so we should add the None type checking to libvirt driver for the compatibility of old libvirt.
description: | updated |
Changed in nova: | |
assignee: | nobody → wangpan (hzwangpan) |
Fix proposed to branch: master /review. openstack. org/81475
Review: https:/