Commit 36893943 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Use iflag=fullblock in dd when copying the image

When copying the image data to the VM's hard disk, use iflag=fullblock
to accumulate full blocks of input. Without this flag, dd will write
the read data whenever read() syscall returns, without waiting to gather
enough data to create a bs-sized block. This may lead to unoptimized
performance.
parent d56a77a6
......@@ -159,9 +159,9 @@ if [ "$BACKEND_TYPE" = "local" ]; then
# Deploying an image file on a target block device is a streaming copy
# operation. Enable the direct I/O flag on the output fd to avoid polluting
# the host cache with useless data.
$monitor dd bs=4M if="$image_file" of="$target" oflag=direct
$monitor dd bs=4M if="$image_file" of="$target" oflag=direct iflag=fullblock
else
$image_cmd | $monitor dd bs=4M of="$target" oflag=direct
$image_cmd | $monitor dd bs=4M of="$target" oflag=direct iflag=fullblock
fi
report_info "Image copy finished."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment