libvirt gancho qemu suse12

1

temos esse gancho qemu. No suse 11 estava funcionando bem, mas no suse 12 não está funcionando. O gancho está definindo as portas em openvswitch nativo-sem tag. Você sabe se existe alguma configuração de libvirt faltando no suse 12 para o hook funcionar? Estamos usando esta versão do libvirt: libvirtd (libvirt) 1.2.5

Obrigado e BR / Cristina

#!/bin/bash

#/etc/libvirt/hooks/qemu
domain_name="$1"
domain_task="$2"

# Create temporary file to hold the configuration.
guest_cfg='mktemp'

function cleanup() {
  if [ -n "$guest_cfg" ]; then
   rm -f $guest_cfg
  fi
}

trap cleanup EXIT

function ovs_untag_port() {
  # Read XML configuration on stdin.
  cat - > $guest_cfg
  ifaces='xpath $guest_cfg         

"count(//devices/interface[@type='network']/target[@dev])" 2>/dev/null'
 for i in 'seq 1 $ifaces'; do
 interface='xpath $guest_cfg "//devices/interface[$i]  

[@type='network']/target[@dev]" 2>/dev/null | cut -d \" -f2'
echo ${interface}
ovs-vsctl set port ${interface} vlan_mode=native-untagged
 done
 cleanup

}


case "${domain_task}" in
  prepare)
    ovs_untag_port
    ;;
  start)
    ;;
  started)
    ovs_untag_port
    ;;
  stopped)
    ;;
  release)
    ;;
  migrate)
    ;;
  restore)
    ;;
  reconnect)
    ;;
  attach)
    ;;
  *)
    exit 0
    echo "qemu hook called with unexpected options $*" >&2
    ;;
esac

exit 0
    
por user3310397 02.06.2015 / 09:21

0 respostas