2011-04-10 03:32:30 +04:00
#
2013-10-28 00:59:46 +04:00
# Copyright (C) 2011, 2013 Red Hat, Inc.
2011-04-10 03:32:30 +04:00
# Copyright (C) 2011 Cole Robinson <crobinso@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
#
2013-09-23 02:13:24 +04:00
from virtinst import NodeDevice
2011-04-10 03:32:30 +04:00
2014-09-13 00:10:45 +04:00
from . libvirtobject import vmmLibvirtObject
2011-04-10 03:32:30 +04:00
2013-04-13 22:34:52 +04:00
2013-09-23 16:34:50 +04:00
def _parse_convert ( conn , parsexml = None ) :
return NodeDevice . parse ( conn , parsexml )
2011-04-10 03:32:30 +04:00
class vmmNodeDevice ( vmmLibvirtObject ) :
2013-07-07 16:42:57 +04:00
def __init__ ( self , conn , backend , key ) :
2013-09-23 16:34:50 +04:00
vmmLibvirtObject . __init__ ( self , conn , backend , key , _parse_convert )
2011-04-10 03:32:30 +04:00
2015-04-10 16:15:44 +03:00
def _conn_tick_poll_param ( self ) :
return " pollnodedev "
def class_name ( self ) :
return " nodedev "
2011-04-10 03:32:30 +04:00
def _XMLDesc ( self , flags ) :
return self . _backend . XMLDesc ( flags )
2015-04-10 01:02:42 +03:00
def _get_backend_status ( self ) :
return self . _STATUS_ACTIVE
2015-04-10 21:08:25 +03:00
def _backend_get_name ( self ) :
return self . get_connkey ( )
2011-04-10 05:56:05 +04:00
def is_active ( self ) :
return True
2016-08-11 17:10:09 +03:00
def _using_events ( self ) :
return self . conn . using_node_device_events
2011-04-10 05:56:05 +04:00
2015-04-10 16:15:44 +03:00
def tick ( self , stats_update = True ) :
2015-04-10 21:08:25 +03:00
# Deliberately empty
2015-04-10 16:15:44 +03:00
ignore = stats_update
2015-04-10 21:08:25 +03:00
def _init_libvirt_state ( self ) :
2015-04-13 22:43:48 +03:00
self . ensure_latest_xml ( )