]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: improve efficiency of dd during snapshots
authorEric Blake <eblake@redhat.com>
Wed, 22 Dec 2010 20:48:05 +0000 (13:48 -0700)
committerEric Blake <eblake@redhat.com>
Tue, 15 Mar 2011 22:35:43 +0000 (16:35 -0600)
commit8e42c50bd4e60ebcdcdafb195204383856fdaf2d
tree412e2b9b0d41b3874be67138a48f1b569de9cfac
parent6eaa4ee41b69978c7e18ce896f537b0afc552446
qemu: improve efficiency of dd during snapshots

POSIX states about dd:

If the bs=expr operand is specified and no conversions other than
sync, noerror, or notrunc are requested, the data returned from each
input block shall be written as a separate output block; if the read
returns less than a full block and the sync conversion is not
specified, the resulting output block shall be the same size as the
input block. If the bs=expr operand is not specified, or a conversion
other than sync, noerror, or notrunc is requested, the input shall be
processed and collected into full-sized output blocks until the end of
the input is reached.

Since we aren't using conv=sync, there is no zero-padding, but our
use of bs= means that a short read results in a short write.  If
instead we use ibs= and obs=, then short reads are collected and dd
only has to do a single write, which can make dd more efficient.

* src/qemu/qemu_monitor.c (qemuMonitorMigrateToFile):
Avoid 'dd bs=', since it can cause short writes.
src/qemu/qemu_monitor.c