#!/bin/bash echo "wsargs=$@" guest_name="$1" operation="$2" # Operation migrate will: # 1. Trigger migrate->prepare->start->started operation on the destination host. # 2. Trigger stopped->release operations on the source host. if [[ "$operation" == "started" || "$operation" == "stopped" ]] then ws_open_flag="" ws_port_flag="" if [[ "$operation" == "started" ]] then ws_open_flag="--open" # libvirt hooks cannot call anything related to libvirt, i.e., # virsh because a deadlock will happen. server_vnc_port=$(grep "