[virt-tools-list] [virt-manager] [PATCH v2 4/4] char: Track/Show the state of virtio channels in channel details
Lin Ma
lma at suse.com
Wed Jul 4 08:10:38 UTC 2018
Signed-off-by: Lin Ma <lma at suse.com>
---
ui/details.ui | 25 +++++++++++++++++++++++++
virtManager/connection.py | 7 +++++++
virtManager/details.py | 1 +
virtinst/devices/char.py | 4 +++-
4 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/ui/details.ui b/ui/details.ui
index 3018354b..13b71aeb 100644
--- a/ui/details.ui
+++ b/ui/details.ui
@@ -4438,6 +4438,19 @@
<property name="top_attach">5</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="char-target-state">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">label507</property>
+ <property name="selectable">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">6</property>
+ </packing>
+ </child>
<child>
<object class="GtkLabel" id="char-source-host">
<property name="visible">True</property>
@@ -4498,6 +4511,18 @@
<property name="top_attach">5</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="char-target-state-label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">end</property>
+ <property name="label" translatable="yes">State:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">6</property>
+ </packing>
+ </child>
<child>
<object class="GtkLabel" id="char-source-path-label">
<property name="visible">True</property>
diff --git a/virtManager/connection.py b/virtManager/connection.py
index 8539be7e..387ba6b0 100644
--- a/virtManager/connection.py
+++ b/virtManager/connection.py
@@ -771,6 +771,13 @@ class vmmConnection(vmmGObject):
logging.debug("domain agent lifecycle event: domain=%s %s", name,
LibvirtEnumMap.domain_agent_lifecycle_str(state, reason))
+ obj = self.get_vm(name)
+
+ if obj:
+ self.idle_add(obj.recache_from_event_loop)
+ else:
+ self.schedule_priority_tick(pollvm=True, force=True)
+
def _network_lifecycle_event(self, conn, network, state, reason, userdata):
ignore = conn
ignore = userdata
diff --git a/virtManager/details.py b/virtManager/details.py
index e30517f9..145101c2 100644
--- a/virtManager/details.py
+++ b/virtManager/details.py
@@ -2941,6 +2941,7 @@ class vmmDetails(vmmGObjectUI):
show_ui("source_path")
show_ui("target_type")
show_ui("target_name")
+ show_ui("target_state")
def refresh_hostdev_page(self):
hostdev = self.get_hw_selection(HW_LIST_COL_DEVICE)
diff --git a/virtinst/devices/char.py b/virtinst/devices/char.py
index 3f364d76..4bbe4198 100644
--- a/virtinst/devices/char.py
+++ b/virtinst/devices/char.py
@@ -180,7 +180,7 @@ class _DeviceChar(Device):
"bind_host", "bind_port",
"source_mode", "source_host", "source_port",
"_source_path", "source_channel",
- "target_type", "target_name"]
+ "target_type", "target_name", "target_state"]
type = XMLProperty("./@type")
_tty = XMLProperty("./@tty")
@@ -199,6 +199,8 @@ class _DeviceChar(Device):
source_master = XMLProperty("./source/@master")
source_slave = XMLProperty("./source/@slave")
+ target_state = XMLProperty("./target/@state")
+
###################
# source handling #
--
2.15.1
More information about the virt-tools-list
mailing list