Browse Source

KVM: Newer version of libvirt require a namespace to have : in it's name.

  A valid configuration for setting MTUs values for virtal interfaces may look
  like this now:

  <metadata>
    <ffho:net xmlns:ffho="https://ffho.net/libvirt/">
      <interface name="gw01_v1001">
        <mtu size="1610"/>
      </interface>
      <interface name="gw01_v1205">
        <mtu size="1610"/>
      </interface>
    </ffho:net>
  </metadata>

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Maximilian Wilhelm 3 years ago
parent
commit
2bc3dabd82
1 changed files with 1 additions and 1 deletions
  1. 1 1
      kvm/qemu-hook

+ 1 - 1
kvm/qemu-hook

@@ -69,7 +69,7 @@ echo "${domain_xml}" | xmlstarlet sel -t -m '//interface[@type="bridge"]' -v 'co
 
 	# We dont' care about "no vlan filtering AND no vlan id" as well as "vlan filtering AND no vlan id"
 
-	mtu=$(echo "${domain_xml}" | xmlstarlet sel -t -m "//metadata/ffho/interface[@name='${iface}']" -v 'mtu/@size'  --nl || true)
+	mtu=$(echo "${domain_xml}" | xmlstarlet sel -N ffho="https://ffho.net/libvirt/" -t -m "//ffho:net/interface[@name='${iface}']" -v 'mtu/@size'  --nl || true)
 	if [ "${mtu}" ]; then
 		ip link set mtu "${mtu}" dev "${iface}"
 		logger -t "${my_name}" "Setting MTU of ${iface} to ${mtu}."