2013-10-28 04:59:46 +08:00
|
|
|
# Copyright (C) 2011, 2013 Red Hat, Inc.
|
2011-04-10 07:32:30 +08:00
|
|
|
# Copyright (C) 2011 Cole Robinson <crobinso@redhat.com>
|
|
|
|
#
|
2018-04-04 21:35:41 +08:00
|
|
|
# This work is licensed under the GNU GPLv2 or later.
|
2018-03-21 03:00:02 +08:00
|
|
|
# See the COPYING file in the top-level directory.
|
2011-04-10 07:32:30 +08:00
|
|
|
|
2013-09-23 06:13:24 +08:00
|
|
|
from virtinst import NodeDevice
|
2011-04-10 07:32:30 +08:00
|
|
|
|
2014-09-13 04:10:45 +08:00
|
|
|
from .libvirtobject import vmmLibvirtObject
|
2011-04-10 07:32:30 +08:00
|
|
|
|
2013-04-14 02:34:52 +08:00
|
|
|
|
2013-09-23 20:34:50 +08:00
|
|
|
def _parse_convert(conn, parsexml=None):
|
|
|
|
return NodeDevice.parse(conn, parsexml)
|
|
|
|
|
|
|
|
|
2011-04-10 07:32:30 +08:00
|
|
|
class vmmNodeDevice(vmmLibvirtObject):
|
2013-07-07 20:42:57 +08:00
|
|
|
def __init__(self, conn, backend, key):
|
2013-09-23 20:34:50 +08:00
|
|
|
vmmLibvirtObject.__init__(self, conn, backend, key, _parse_convert)
|
2011-04-10 07:32:30 +08:00
|
|
|
|
2015-04-10 21:15:44 +08:00
|
|
|
def _conn_tick_poll_param(self):
|
|
|
|
return "pollnodedev"
|
|
|
|
def class_name(self):
|
|
|
|
return "nodedev"
|
|
|
|
|
2011-04-10 07:32:30 +08:00
|
|
|
def _XMLDesc(self, flags):
|
|
|
|
return self._backend.XMLDesc(flags)
|
2015-04-10 06:02:42 +08:00
|
|
|
def _get_backend_status(self):
|
|
|
|
return self._STATUS_ACTIVE
|
2015-04-11 02:08:25 +08:00
|
|
|
def _backend_get_name(self):
|
|
|
|
return self.get_connkey()
|
2011-04-10 09:56:05 +08:00
|
|
|
def is_active(self):
|
|
|
|
return True
|
2016-08-11 22:10:09 +08:00
|
|
|
def _using_events(self):
|
|
|
|
return self.conn.using_node_device_events
|
2011-04-10 09:56:05 +08:00
|
|
|
|
2015-04-10 21:15:44 +08:00
|
|
|
def tick(self, stats_update=True):
|
2015-04-11 02:08:25 +08:00
|
|
|
# Deliberately empty
|
2015-04-10 21:15:44 +08:00
|
|
|
ignore = stats_update
|
2015-04-11 02:08:25 +08:00
|
|
|
def _init_libvirt_state(self):
|
2015-04-14 03:43:48 +08:00
|
|
|
self.ensure_latest_xml()
|