From 29d431a36f3be34e81775c688ca71db297aa8c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= Date: Sat, 7 Dec 2024 23:32:25 +0000 Subject: cleanup get_config() No functional change intended. --- qemu | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'qemu') diff --git a/qemu b/qemu index c1b0206..b4272dd 100755 --- a/qemu +++ b/qemu @@ -49,9 +49,11 @@ get_address_family(){ [ -z "${1##*:*}" ] && echo ipv6 || echo ipv4; } get_config(){ local configfile="$1" - local ns="https://2e8.dk/libvirt-routed-subnet" + local tag = 'routed-subnet' + local ns='https://2e8.dk/libvirt-routed-subnet' + local query = "//*[local-name()='$tag' and namespace-uri()='$ns']" fullxml="$(cat "$configfile")" - routingxml="$(xpath "//*[local-name()='routed-subnet' and namespace-uri()='$ns']" "$fullxml")" + routingxml="$(xpath "$query" "$fullxml")" } get_device(){ -- cgit v1.2.1