summaryrefslogtreecommitdiff
path: root/virtManager
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@redhat.com>2022-05-18 17:03:30 -0500
committerCole Robinson <crobinso@redhat.com>2022-06-13 13:49:08 -0400
commitcaa99a6001be0c86a1dd0eb5fc0ce142ab929a31 (patch)
tree259bfc7cb6dd1298a3240535f6d5840095bce96f /virtManager
parent44355e5ed0d0791675e8113732dde37664d5aa91 (diff)
downloadvirt-manager-caa99a6001be0c86a1dd0eb5fc0ce142ab929a31.tar.gz
virt-manager: add support for qemu-vdagent channel
This provides the UI support for the qemu-vdagent channel which allows clipboard sharing with VNC graphics (see previous commit for more information). The channel name in the device list was changed slightly in order to avoid confusion. Due to the fact that both the spice-vdagent and the qemu-vdagent specify the same virtio name (com.redhat.spice.0), both of these channels were showing up in the device list as "Channel spice", which is a bit confusing. In order to disambiguate these, channels now show up in the device list as "Channel {type} ({name})" instead of "Channel {name}". So for example, a qemu-vdagent channel would show up as: Channel Qemu vdagent (spice) Whereas a spice-vdagent channel would show up as: Channel Spice agent (spice) Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Diffstat (limited to 'virtManager')
-rw-r--r--virtManager/addhardware.py10
-rw-r--r--virtManager/details/details.py7
2 files changed, 14 insertions, 3 deletions
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index 8c7fa0c7..0a8e33d3 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -308,6 +308,7 @@ class vmmAddHardware(vmmGObjectUI):
self.widget("char-path").set_text("")
self.widget("char-channel").set_text("")
self.widget("char-auto-socket").set_active(True)
+ self.widget("char-vdagent-clipboard").set_active(True)
# RNG params
@@ -399,7 +400,8 @@ class vmmAddHardware(vmmGObjectUI):
DeviceSerial.TYPE_UNIX]
if char_class.XML_NAME == "channel":
ret = [DeviceSerial.TYPE_SPICEVMC,
- DeviceSerial.TYPE_SPICEPORT] + ret
+ DeviceSerial.TYPE_SPICEPORT,
+ DeviceSerial.TYPE_QEMUVDAGENT] + ret
return ret
@staticmethod
@@ -425,6 +427,7 @@ class vmmAddHardware(vmmGObjectUI):
DeviceSerial.TYPE_UNIX: _("UNIX socket"),
DeviceSerial.TYPE_SPICEVMC: _("Spice agent"),
DeviceSerial.TYPE_SPICEPORT: _("Spice port"),
+ DeviceSerial.TYPE_QEMUVDAGENT: _("QEMU vdagent"),
}
return labels.get(val, val)
@@ -1114,11 +1117,14 @@ class vmmAddHardware(vmmGObjectUI):
supports_path = [dev.TYPE_FILE, dev.TYPE_UNIX,
dev.TYPE_DEV, dev.TYPE_PIPE]
supports_channel = [dev.TYPE_SPICEPORT]
+ supports_clipboard = [dev.TYPE_QEMUVDAGENT]
uiutil.set_grid_row_visible(self.widget("char-path-label"),
devtype in supports_path)
uiutil.set_grid_row_visible(self.widget("char-channel-label"),
devtype in supports_channel)
+ uiutil.set_grid_row_visible(self.widget("char-vdagent-clipboard-label"),
+ devtype in supports_clipboard)
uiutil.set_grid_row_visible(
self.widget("char-target-name-label"), ischan)
@@ -1472,6 +1478,7 @@ class vmmAddHardware(vmmGObjectUI):
source_channel = self.widget("char-channel").get_text()
target_name = self.widget("char-target-name").get_child().get_text()
target_type = uiutil.get_list_selection(typebox)
+ clipboard = self.widget("char-vdagent-clipboard").get_active()
if not self.widget("char-path").get_visible():
source_path = None
@@ -1486,6 +1493,7 @@ class vmmAddHardware(vmmGObjectUI):
dev.type = devtype
dev.source.path = source_path
dev.source.channel = source_channel
+ dev.source.clipboard_copypaste = clipboard
dev.target_name = target_name
dev.target_type = target_type
return dev
diff --git a/virtManager/details/details.py b/virtManager/details/details.py
index 24810f0f..ddc43b76 100644
--- a/virtManager/details/details.py
+++ b/virtManager/details/details.py
@@ -207,10 +207,10 @@ def _label_for_device(dev, disk_bus_index):
return _("Console %(num)d") % {"num": port + 1}
if devtype == "channel":
+ pretty_type = vmmAddHardware.char_pretty_type(dev.type)
name = vmmAddHardware.char_pretty_channel_name(dev.target_name)
if name:
- return _("Channel %(name)s") % {"name": name}
- pretty_type = vmmAddHardware.char_pretty_type(dev.type)
+ return _("Channel %(type)s (%(name)s)") % {"type": pretty_type, "name": name}
return _("Channel %(type)s") % {"type": pretty_type}
if devtype == "graphics":
@@ -2098,6 +2098,7 @@ class vmmDetails(vmmGObjectUI):
primary = self.vm.serial_is_console_dup(chardev)
show_target_type = not (char_type in ["serial", "parallel"])
is_qemuga = chardev.target_name == chardev.CHANNEL_NAME_QEMUGA
+ show_clipboard = chardev.type == chardev.TYPE_QEMUVDAGENT
if char_type == "serial":
typelabel = _("Serial Device")
@@ -2152,6 +2153,8 @@ class vmmDetails(vmmGObjectUI):
# notifiations about connection state. For spice this UI field
# can get out of date
show_ui("char-target-state", chardev.target_state, doshow=is_qemuga)
+ clipboard = _("On") if chardev.source.clipboard_copypaste else _("Off")
+ show_ui("char-clipboard-sharing", clipboard, doshow=show_clipboard)
def _refresh_hostdev_page(self, hostdev):
rom_bar = hostdev.rom_bar