mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
virt: don't add spicevmc channel to Xen VMs
Xen fully virtualized VMs with spicevmc channel fail to start, so better not write it out in such cases.
This commit is contained in:
parent
5c6f05909d
commit
39207dd38d
3 changed files with 12 additions and 3 deletions
1
changelog/59416.fixed
Normal file
1
changelog/59416.fixed
Normal file
|
@ -0,0 +1 @@
|
|||
Don't create spicevmc channel for Xen virtual machines
|
|
@ -285,7 +285,7 @@
|
|||
autoport='{{ yesno(not graphics.port and not graphics.tls_port) }}'>
|
||||
<listen type='{{ graphics.listen.type }}'{{ opt_attribute(graphics.listen, "address") }}/>
|
||||
</graphics>
|
||||
{%- if graphics.type == "spice" %}
|
||||
{%- if graphics.type == "spice" and hypervisor in ["qemu", "kvm"] %}
|
||||
<channel type='spicevmc'>
|
||||
<target type='virtio' name='com.redhat.spice.0'/>
|
||||
</channel>
|
||||
|
|
|
@ -2130,7 +2130,8 @@ def test_update_failure(make_mock_vm):
|
|||
}
|
||||
|
||||
|
||||
def test_gen_xml_spice_default():
|
||||
@pytest.mark.parametrize("hypervisor", ["kvm", "xen"])
|
||||
def test_gen_xml_spice_default(hypervisor):
|
||||
"""
|
||||
Test virt._gen_xml() with default spice graphics device
|
||||
"""
|
||||
|
@ -2141,7 +2142,7 @@ def test_gen_xml_spice_default():
|
|||
512,
|
||||
{},
|
||||
{},
|
||||
"kvm",
|
||||
hypervisor,
|
||||
"hvm",
|
||||
"x86_64",
|
||||
graphics={"type": "spice"},
|
||||
|
@ -2152,6 +2153,13 @@ def test_gen_xml_spice_default():
|
|||
assert root.find("devices/graphics").attrib["listen"] == "0.0.0.0"
|
||||
assert root.find("devices/graphics/listen").attrib["type"] == "address"
|
||||
assert root.find("devices/graphics/listen").attrib["address"] == "0.0.0.0"
|
||||
if hypervisor == "kvm":
|
||||
assert (
|
||||
root.find(".//channel[@type='spicevmc']/target").get("name")
|
||||
== "com.redhat.spice.0"
|
||||
)
|
||||
else:
|
||||
assert root.find(".//channel[@type='spicevmc']") is None
|
||||
|
||||
|
||||
def test_gen_xml_spice():
|
||||
|
|
Loading…
Add table
Reference in a new issue