41 lines
1.1 KiB
Python
Raw Normal View History

# Copyright (C) 2011, 2013 Red Hat, Inc.
2011-04-09 19:32:30 -04:00
# Copyright (C) 2011 Cole Robinson <crobinso@redhat.com>
#
# This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.
2011-04-09 19:32:30 -04:00
2013-09-22 18:13:24 -04:00
from virtinst import NodeDevice
2011-04-09 19:32:30 -04:00
from .libvirtobject import vmmLibvirtObject
2011-04-09 19:32:30 -04:00
def _parse_convert(conn, parsexml=None):
return NodeDevice.parse(conn, parsexml)
2011-04-09 19:32:30 -04:00
class vmmNodeDevice(vmmLibvirtObject):
def __init__(self, conn, backend, key):
vmmLibvirtObject.__init__(self, conn, backend, key, _parse_convert)
2011-04-09 19:32:30 -04:00
def _conn_tick_poll_param(self):
return "pollnodedev"
def class_name(self):
return "nodedev"
2011-04-09 19:32:30 -04:00
def _XMLDesc(self, flags):
return self._backend.XMLDesc(flags)
def _get_backend_status(self):
return self._STATUS_ACTIVE
def _backend_get_name(self):
return self.get_connkey()
2011-04-09 21:56:05 -04:00
def is_active(self):
return True
def _using_events(self):
return self.conn.using_node_device_events
2011-04-09 21:56:05 -04:00
def tick(self, stats_update=True):
# Deliberately empty
ignore = stats_update
def _init_libvirt_state(self):
2015-04-13 15:43:48 -04:00
self.ensure_latest_xml()