summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2022-01-17 13:44:37 -0500
committerCole Robinson <crobinso@redhat.com>2022-01-17 14:37:06 -0500
commit499badbdf4b0b3914a6078f7f37234dd6613ab1e (patch)
tree1bc39bcc65d9a6f99eda3a183a32eabdb214ef41
parentc51ebdd76a9fc198c40cefcd78838860199467d3 (diff)
downloadvirt-manager-499badbdf4b0b3914a6078f7f37234dd6613ab1e.tar.gz
object: nodedev: support isActive state
This was added to libvirt in the past few years, and we may want it for mdev addhardware UI Signed-off-by: Cole Robinson <crobinso@redhat.com>
-rw-r--r--virtManager/object/nodedev.py7
-rw-r--r--virtinst/support.py5
2 files changed, 12 insertions, 0 deletions
diff --git a/virtManager/object/nodedev.py b/virtManager/object/nodedev.py
index 797569b2..a89663fb 100644
--- a/virtManager/object/nodedev.py
+++ b/virtManager/object/nodedev.py
@@ -57,6 +57,13 @@ class vmmNodeDevice(vmmLibvirtObject):
return self._STATUS_ACTIVE
def _using_events(self):
return self.conn.using_node_device_events
+ def _get_backend_status(self):
+ is_active = True
+ if self.conn.support.nodedev_isactive(self._backend):
+ is_active = self._backend.isActive()
+ return (is_active and
+ self._STATUS_ACTIVE or
+ self._STATUS_INACTIVE)
def pretty_name(self):
return _pretty_name(self.xmlobj)
diff --git a/virtinst/support.py b/virtinst/support.py
index 5511bb7a..b43e024e 100644
--- a/virtinst/support.py
+++ b/virtinst/support.py
@@ -304,6 +304,11 @@ class SupportCache:
flag="VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA",
version="1.0.1")
+ # Nodedev checks
+ # Added in libvirt 7.8.0 mid 2021
+ nodedev_isactive = _make(
+ function="virNodeDevice.isActive", run_args=())
+
def _check_version(self, version):
"""