我们有这个qemu钩子。 在十一期间工作很好,但在十二期间它不工作。 挂钩是在openvswitch native-untagged中设置端口。 你知道是否有一些libvirt缺lessconfiguration在suse 12的钩子工作? 我们正在使用这个版本的libvirt:libvirtd(libvirt)1.2.5
谢谢BR和克里斯蒂娜
#!/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