snapshots: Handle XML chars in snapshot name (bz 1468912)

https://bugzilla.redhat.com/show_bug.cgi?id=1468912
This commit is contained in:
Cole Robinson 2017-07-10 17:51:04 -04:00
parent 12962ece71
commit a51929fcd3
2 changed files with 4 additions and 3 deletions

View File

@ -1094,7 +1094,7 @@ ba</description>
</test:domainsnapshot>
<test:domainsnapshot>
<name>internal-root-child1</name>
<name>internal-root-child1&amp;</name>
<state>running</state>
<parent>
<name>internal-root</name>

View File

@ -233,7 +233,7 @@ class vmmSnapshotPage(vmmGObjectUI):
for snap in snapshots:
desc = snap.get_xmlobj().description
name = snap.get_name()
state = util.xml_escape(snap.run_status())
state = snap.run_status()
if snap.is_external():
has_external = True
sortname = "3%s" % name
@ -244,7 +244,8 @@ class vmmSnapshotPage(vmmGObjectUI):
sortname = "1%s" % name
label = "%s\n<span size='small'>%s: %s%s</span>" % (
(name, _("VM State"), state, external))
(util.xml_escape(name), _("VM State"),
util.xml_escape(state), external))
model.append([name, label, desc, snap.run_status_icon_name(),
sortname, snap.is_current()])