diff --git a/src/vmm_mad/remotes/kvm/migrate b/src/vmm_mad/remotes/kvm/migrate index 145db8c6ef..4b1e92c2f4 100755 --- a/src/vmm_mad/remotes/kvm/migrate +++ b/src/vmm_mad/remotes/kvm/migrate @@ -76,9 +76,10 @@ create_target_disk_img() { local DEST_HOST=$1 local QEMU_IMG_PATH="$2" local SIZE="$3" + local DISK_DIR=$(dirname $QEMU_IMG_PATH) ssh_monitor_and_log "$DEST_HOST" \ - "qemu-img create -f qcow2 '$QEMU_IMG_PATH' '$SIZE'" \ + "mkdir -p $DISK_DIR && qemu-img create -f qcow2 '$QEMU_IMG_PATH' '$SIZE'" \ "Failed to create new qcow image for $QEMU_IMG_PATH" }