From 8638fe3f860a13e581330bdaa947d2a3fb48e4a3 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Tue, 17 Oct 2017 17:10:10 +0100 Subject: [PATCH] ts-debian-fixup: merge origin extra= to our own if necessary The original extra= was not removed, so there were two extra= in the resulting config file. It wasn't a problem for xl because the second extra= took precedence. However libvirt tests would only pick up the first extra= so they worked by chance. Fix this issue by merging the original. If there isn't already extra= in $cfg, use our own. Signed-off-by: Wei Liu Acked-by: Ian Jackson --- v3: handle situation when no extra= is in $cfg --- ts-debian-fixup | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ts-debian-fixup b/ts-debian-fixup index 3e5cdb9..478dc2a 100755 --- a/ts-debian-fixup +++ b/ts-debian-fixup @@ -178,7 +178,11 @@ sub otherfixupcfg () { $extra .= " iommu=soft"; } - $cfg .= "\nextra='$extra'\n"; + if ($cfg =~ m/extra\s*=\s*['"](.*)['"]/) { + $cfg =~ s/extra\s*=\s*['"](.*)['"]/extra = '$1 $extra'/; + } else { + $cfg .= "extra = '$extra'\n"; + } }; sub writecfg () { -- 2.39.5