From: Eric Blake <eblake@redhat.com>
To: Tim Haley <timhaley2112@gmail.com>,
qemu-devel@nongnu.org,
"libvirt-list@redhat.com" <libvirt-list@redhat.com>
Subject: Re: Domain backup file explodes on s3fs
Date: Tue, 7 Apr 2020 14:37:26 -0500 [thread overview]
Message-ID: <31d320ff-4ac7-80f5-e201-c059918697eb@redhat.com> (raw)
In-Reply-To: <0d78c593-7b5d-5f73-ea05-e81d9bc35373@gmail.com>
[adding libvirt list]
On 4/7/20 2:13 PM, Tim Haley wrote:
> Hi all,
>
> Have been playing with `virsh backup-begin` of late and think it's an
> excellent feature. I've noticed one behavior I'm not sure I understand.
It looks like https://bugzilla.redhat.com/show_bug.cgi?id=1814664 is a
similar description of the same problem: namely, if qemu is not able to
determine that the destination already reads as zero, then it forcefully
zeroes the destination of a backup job. We may want to copy the fact
that qemu 5.0 is adding 'qemu-img convert --target-is-zero' to add a
similar knob to the QMP commands that trigger disk copying
(blockdev-backup, blockdev-mirror, possibly others) as well as logic to
avoid writing zeroes when the destination is already treated as zero
(whether by a probe, or by the knob being set).
...
> If my /backups directory is just XFS, I get a backup file that looks
> like it is just the size of data blocks in use
>
> -rw------- 1 root root 2769551360 Mar 19 16:56
> vda.2aa450cc-6d2e-11ea-8de0-52542e0d008a
For a local file, qemu is easily able to probe whether the destination
starts as all zeroes (thanks to lseek(SEEK_DATA));
>
> but if I write to an s3fs (object storage backend) the file blows up to
> the whole size of the disk
>
> -rw------- 1 root root 8591507456 Mar 18 19:03
> vda.2aa450cc-6d2e-11ea-8de0-52542e0d008a
whereas for s3fs, it looks like qemu does not have access to a quick
test to learn if the image starts all zero (POSIX does not provide a
quick way for doing this on a generic block device, but if you are aware
of an ioctl or otherwise that qemu could use, that might be helpful).
Or maybe the s3fs really is random contents rather than all zero, in
which case forcefully writing zeroes is the only correct behavior.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2020-04-07 19:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-07 19:13 Domain backup file explodes on s3fs Tim Haley
2020-04-07 19:37 ` Eric Blake [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-04-13 17:57 Leo Luan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=31d320ff-4ac7-80f5-e201-c059918697eb@redhat.com \
--to=eblake@redhat.com \
--cc=libvirt-list@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=timhaley2112@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).