]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virsh: Track if vol-upload or vol-download work over a block device
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 2 Jul 2020 06:51:20 +0000 (08:51 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 24 Aug 2020 11:32:53 +0000 (13:32 +0200)
commit8a0c327f112d959ee54333426c4ae99370ad4daa
tree22da291d3e05ca7b81a35e8313e116949b6430ba
parent9e745a97171e10f050962c166082439d6724e245
virsh: Track if vol-upload or vol-download work over a block device

We can't use virFileInData() with block devices, but we can
emulate being in data section all the time (vol-upload case).
Alternatively, we can't just lseek() beyond EOF with block
devices to create a hole, we will have to write zeroes
(vol-download case).  But to decide we need to know if the FD we
are reading data from / writing data to is a block device. Store
this information in _virshStreamCallbackData.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
tools/virsh-util.h
tools/virsh-volume.c