diff --git a/src/virtManager/delete.py b/src/virtManager/delete.py
index 4830402f..79d267e2 100644
--- a/src/virtManager/delete.py
+++ b/src/virtManager/delete.py
@@ -91,7 +91,7 @@ class vmmDeleteDialog(vmmGObjectUI):
# Set VM name in title'
title_str = ("%s '%s'" %
- (_("Delete"), self.vm.get_name()))
+ (_("Delete"), util.xml_escape(self.vm.get_name())))
self.widget("delete-main-label").set_markup(title_str)
self.widget("delete-cancel").grab_focus()
diff --git a/src/virtManager/manager.py b/src/virtManager/manager.py
index bdbd0af3..d1b0d9ec 100644
--- a/src/virtManager/manager.py
+++ b/src/virtManager/manager.py
@@ -701,12 +701,12 @@ class vmmManager(vmmGObjectUI):
return hint
def _build_conn_markup(self, conn, row):
+ name = util.xml_escape(row[ROW_NAME])
+ text = name
if conn.state == conn.STATE_DISCONNECTED:
- text = str(row[ROW_NAME]) + " - " + _("Not Connected")
+ text += " - " + _("Not Connected")
elif conn.state == conn.STATE_CONNECTING:
- text = str(row[ROW_NAME]) + " - " + _("Connecting...")
- else:
- text = str(row[ROW_NAME])
+ text += " - " + _("Connecting...")
markup = "%s" % text
return markup
@@ -720,7 +720,7 @@ class vmmManager(vmmGObjectUI):
def _build_vm_markup(self, row):
domtext = ("%s" %
- row[ROW_NAME])
+ util.xml_escape(row[ROW_NAME]))
statetext = "%s" % row[ROW_STATUS]
return domtext + "\n" + statetext
diff --git a/src/virtManager/migrate.py b/src/virtManager/migrate.py
index 1096840c..313ada78 100644
--- a/src/virtManager/migrate.py
+++ b/src/virtManager/migrate.py
@@ -122,7 +122,7 @@ class vmmMigrateDialog(vmmGObjectUI):
def reset_state(self):
title_str = ("%s '%s'" %
- (_("Migrate"), self.vm.get_name()))
+ (_("Migrate"), util.xml_escape(self.vm.get_name())))
self.widget("migrate-main-label").set_markup(title_str)
self.widget("migrate-cancel").grab_focus()
diff --git a/src/virtManager/util.py b/src/virtManager/util.py
index cec882f5..d351cb3e 100644
--- a/src/virtManager/util.py
+++ b/src/virtManager/util.py
@@ -29,6 +29,8 @@ import virtinst
running_config = None
+xml_escape = virtinst.util.xml_escape
+
# FIXME: selinux policy also has a ~/VirtualMachines/isos dir
def get_default_pool_path(conn):
if conn.is_session_uri():