2013-10-27 21:59:46 +01:00
# Copyright (C) 2011, 2013 Red Hat, Inc.
2011-04-09 19:32:30 -04:00
# Copyright (C) 2011 Cole Robinson <crobinso@redhat.com>
#
2018-04-04 14:35:41 +01:00
# This work is licensed under the GNU GPLv2 or later.
2018-03-20 15:00:02 -04:00
# 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
2014-09-12 16:10:45 -04:00
from . libvirtobject import vmmLibvirtObject
2011-04-09 19:32:30 -04:00
2013-04-13 14:34:52 -04:00
2013-09-23 08:34:50 -04:00
def _parse_convert ( conn , parsexml = None ) :
return NodeDevice . parse ( conn , parsexml )
2011-04-09 19:32:30 -04:00
class vmmNodeDevice ( vmmLibvirtObject ) :
2013-07-07 08:42:57 -04:00
def __init__ ( self , conn , backend , key ) :
2013-09-23 08:34:50 -04:00
vmmLibvirtObject . __init__ ( self , conn , backend , key , _parse_convert )
2011-04-09 19:32:30 -04:00
2015-04-10 09:15:44 -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 )
2015-04-09 18:02:42 -04:00
def _get_backend_status ( self ) :
return self . _STATUS_ACTIVE
2015-04-10 14:08:25 -04:00
def _backend_get_name ( self ) :
return self . get_connkey ( )
2011-04-09 21:56:05 -04:00
def is_active ( self ) :
return True
2016-08-11 16:10:09 +02:00
def _using_events ( self ) :
return self . conn . using_node_device_events
2011-04-09 21:56:05 -04:00
2015-04-10 09:15:44 -04:00
def tick ( self , stats_update = True ) :
2015-04-10 14:08:25 -04:00
# Deliberately empty
2015-04-10 09:15:44 -04:00
ignore = stats_update
2015-04-10 14:08:25 -04:00
def _init_libvirt_state ( self ) :
2015-04-13 15:43:48 -04:00
self . ensure_latest_xml ( )