From fe72fe16815e15a8c2fff778961a784afd1ab09d Mon Sep 17 00:00:00 2001 From: Pawel Marczewski Date: Wed, 22 Jan 2020 11:10:50 +0100 Subject: [PATCH] Fix overlapping block device names This was caused by a change in Jinja template engine that breaks assignments like {% set i = i + 1 %} in a loop. Jinja 2.10 introduces a "namespace" object for this use case, but unfortunately dom0-fc25 uses 2.8.1. See: https://github.com/pallets/jinja/issues/641 https://github.com/pallets/jinja/pull/684 Fixes QubesOS/qubes-issues#5551. --- qubes/tests/vm/qubesvm.py | 144 ++++++++++++++++++++++++++++ templates/libvirt/devices/block.xml | 4 +- templates/libvirt/xen.xml | 18 +++- 3 files changed, 159 insertions(+), 7 deletions(-) diff --git a/qubes/tests/vm/qubesvm.py b/qubes/tests/vm/qubesvm.py index d64c920c..ff1da756 100644 --- a/qubes/tests/vm/qubesvm.py +++ b/qubes/tests/vm/qubesvm.py @@ -1469,6 +1469,150 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase): extra_ip=''.format( qubes.config.qubes_ipv6_prefix.replace(':0000', ''))))) + def test_615_libvirt_xml_block_devices(self): + expected = ''' + test-inst-test + 7db78950-c467-4863-94d1-af59806384ea + 400 + 400 + 2 + + + + + + + + + hvm + + hvmloader + + + + + + + + + + + destroy + destroy + destroy + + + + + + +