From 2dbb51a38d0991120bf3d472c897fa9623ba9e48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 3 Jul 2017 23:42:39 +0200 Subject: [PATCH] exc/block: fix attaching block device exposed by dom0 Don't set element in libvirt XML when device is provided by dom0. --- qubes/tests/devices_block.py | 8 +++----- templates/libvirt/devices/block.xml | 2 ++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/qubes/tests/devices_block.py b/qubes/tests/devices_block.py index 820753ec..33620060 100644 --- a/qubes/tests/devices_block.py +++ b/qubes/tests/devices_block.py @@ -345,7 +345,6 @@ class TC_00_Block(qubes.tests.QubesTestCase): ' \n' ' \n' ' \n' - '\n' ' \n' '') vm.libvirt_domain.attachDevice.assert_called_once_with(device_xml) @@ -366,7 +365,6 @@ class TC_00_Block(qubes.tests.QubesTestCase): ' \n' ' \n' ' \n' - '\n' ' \n' '') vm.libvirt_domain.attachDevice.assert_called_once_with(device_xml) @@ -387,7 +385,7 @@ class TC_00_Block(qubes.tests.QubesTestCase): ' \n' ' \n' ' \n' - ' \n\n' + ' \n' ' \n' '') vm.libvirt_domain.attachDevice.assert_called_once_with(device_xml) @@ -462,7 +460,7 @@ class TC_00_Block(qubes.tests.QubesTestCase): ' \n' ' \n' ' \n' - ' \n\n' + ' \n' ' \n' '') vm.libvirt_domain.attachDevice.assert_called_once_with(device_xml) @@ -479,7 +477,7 @@ class TC_00_Block(qubes.tests.QubesTestCase): ' \n' ' \n' ' \n' - ' \n\n' + ' \n' ' \n' '') vm = TestVM({}, domain_xml=domain_xml_template.format(device_xml)) diff --git a/templates/libvirt/devices/block.xml b/templates/libvirt/devices/block.xml index 41327f36..a78dca34 100644 --- a/templates/libvirt/devices/block.xml +++ b/templates/libvirt/devices/block.xml @@ -12,5 +12,7 @@ {%- endif %} + {%- if device.backend_domain.name != 'dom0' %} + {%- endif %}