exc/block: fix attaching block device exposed by dom0
Don't set <backenddomain> element in libvirt XML when device is provided by dom0.
This commit is contained in:
parent
75608795b0
commit
2dbb51a38d
@ -345,7 +345,6 @@ class TC_00_Block(qubes.tests.QubesTestCase):
|
|||||||
' <driver name="phy" />\n'
|
' <driver name="phy" />\n'
|
||||||
' <source dev="/dev/sda" />\n'
|
' <source dev="/dev/sda" />\n'
|
||||||
' <target dev="xvdi" />\n'
|
' <target dev="xvdi" />\n'
|
||||||
'\n'
|
|
||||||
' <backenddomain name="sys-usb" />\n'
|
' <backenddomain name="sys-usb" />\n'
|
||||||
'</disk>')
|
'</disk>')
|
||||||
vm.libvirt_domain.attachDevice.assert_called_once_with(device_xml)
|
vm.libvirt_domain.attachDevice.assert_called_once_with(device_xml)
|
||||||
@ -366,7 +365,6 @@ class TC_00_Block(qubes.tests.QubesTestCase):
|
|||||||
' <driver name="phy" />\n'
|
' <driver name="phy" />\n'
|
||||||
' <source dev="/dev/sda" />\n'
|
' <source dev="/dev/sda" />\n'
|
||||||
' <target dev="xvdj" />\n'
|
' <target dev="xvdj" />\n'
|
||||||
'\n'
|
|
||||||
' <backenddomain name="sys-usb" />\n'
|
' <backenddomain name="sys-usb" />\n'
|
||||||
'</disk>')
|
'</disk>')
|
||||||
vm.libvirt_domain.attachDevice.assert_called_once_with(device_xml)
|
vm.libvirt_domain.attachDevice.assert_called_once_with(device_xml)
|
||||||
@ -387,7 +385,7 @@ class TC_00_Block(qubes.tests.QubesTestCase):
|
|||||||
' <driver name="phy" />\n'
|
' <driver name="phy" />\n'
|
||||||
' <source dev="/dev/sda" />\n'
|
' <source dev="/dev/sda" />\n'
|
||||||
' <target dev="xvdi" />\n'
|
' <target dev="xvdi" />\n'
|
||||||
' <readonly />\n\n'
|
' <readonly />\n'
|
||||||
' <backenddomain name="sys-usb" />\n'
|
' <backenddomain name="sys-usb" />\n'
|
||||||
'</disk>')
|
'</disk>')
|
||||||
vm.libvirt_domain.attachDevice.assert_called_once_with(device_xml)
|
vm.libvirt_domain.attachDevice.assert_called_once_with(device_xml)
|
||||||
@ -462,7 +460,7 @@ class TC_00_Block(qubes.tests.QubesTestCase):
|
|||||||
' <driver name="phy" />\n'
|
' <driver name="phy" />\n'
|
||||||
' <source dev="/dev/sda" />\n'
|
' <source dev="/dev/sda" />\n'
|
||||||
' <target dev="xvdi" />\n'
|
' <target dev="xvdi" />\n'
|
||||||
' <readonly />\n\n'
|
' <readonly />\n'
|
||||||
' <backenddomain name="sys-usb" />\n'
|
' <backenddomain name="sys-usb" />\n'
|
||||||
'</disk>')
|
'</disk>')
|
||||||
vm.libvirt_domain.attachDevice.assert_called_once_with(device_xml)
|
vm.libvirt_domain.attachDevice.assert_called_once_with(device_xml)
|
||||||
@ -479,7 +477,7 @@ class TC_00_Block(qubes.tests.QubesTestCase):
|
|||||||
' <driver name="phy" />\n'
|
' <driver name="phy" />\n'
|
||||||
' <source dev="/dev/sda" />\n'
|
' <source dev="/dev/sda" />\n'
|
||||||
' <target dev="xvdi" />\n'
|
' <target dev="xvdi" />\n'
|
||||||
' <readonly />\n\n'
|
' <readonly />\n'
|
||||||
' <backenddomain name="sys-usb" />\n'
|
' <backenddomain name="sys-usb" />\n'
|
||||||
'</disk>')
|
'</disk>')
|
||||||
vm = TestVM({}, domain_xml=domain_xml_template.format(device_xml))
|
vm = TestVM({}, domain_xml=domain_xml_template.format(device_xml))
|
||||||
|
@ -12,5 +12,7 @@
|
|||||||
<readonly />
|
<readonly />
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- if device.backend_domain.name != 'dom0' %}
|
||||||
<backenddomain name="{{ device.backend_domain.name }}" />
|
<backenddomain name="{{ device.backend_domain.name }}" />
|
||||||
|
{%- endif %}
|
||||||
</disk>
|
</disk>
|
||||||
|
Loading…
Reference in New Issue
Block a user