pollhelpers: Support nodedev listAllDevices

This commit is contained in:
Cole Robinson 2013-09-29 09:39:55 -04:00
parent 52e4976462
commit ddba6098f6
2 changed files with 14 additions and 7 deletions

View File

@ -178,13 +178,18 @@ def fetch_interfaces(backend, origmap, build_func):
def fetch_nodedevs(backend, origmap, build_func):
name = "nodedev"
active_list = lambda: backend.listDevices(None, 0)
inactive_list = lambda: []
lookup_func = backend.nodeDeviceLookupByName
return _old_poll_helper(origmap, name,
active_list, inactive_list,
lookup_func, build_func)
if backend.check_conn_support(
backend.SUPPORT_CONN_LISTALLDEVICES):
return _new_poll_helper(origmap, name,
backend.listAllDevices,
"name", build_func)
else:
active_list = lambda: backend.listDevices(None, 0)
inactive_list = lambda: []
lookup_func = backend.nodeDeviceLookupByName
return _old_poll_helper(origmap, name,
active_list, inactive_list,
lookup_func, build_func)
def _old_fetch_vms(backend, origmap, build_func):

View File

@ -320,6 +320,8 @@ SUPPORT_CONN_LISTALLSTORAGEPOOLS = _make(
args=())
SUPPORT_CONN_LISTALLINTERFACES = _make(function="virConnect.listAllInterfaces",
args=())
SUPPORT_CONN_LISTALLDEVICES = _make(function="virConnect.listAllDevices",
args=())
SUPPORT_CONN_VIRTIO_MMIO = _make(version=1001002,
drv_version=[("qemu", 1006000)])
SUPPORT_CONN_DISK_SD = _make(version=1001002)