aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAsbjørn Sloth Tønnesen <ast@2e8.dk>2024-12-07 23:32:25 +0000
committerAsbjørn Sloth Tønnesen <ast@2e8.dk>2024-12-07 23:36:43 +0000
commit29d431a36f3be34e81775c688ca71db297aa8c4e (patch)
tree3fd0110389797c5395c67f6f9482d2253a7475cf
parentb2fe8986a66a9a130e41b8b9087458ab3e80816a (diff)
downloadlibvirt-routed-subnet-29d431a36f3be34e81775c688ca71db297aa8c4e.tar.gz
libvirt-routed-subnet-29d431a36f3be34e81775c688ca71db297aa8c4e.tar.xz
libvirt-routed-subnet-29d431a36f3be34e81775c688ca71db297aa8c4e.zip
cleanup get_config()
No functional change intended.
-rwxr-xr-xqemu6
1 files changed, 4 insertions, 2 deletions
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(){