qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PATCH v3 2/3] block/backup: avoid copying


From: Eric Blake
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH v3 2/3] block/backup: avoid copying less than full target clusters
Date: Tue, 23 Feb 2016 17:45:44 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

On 02/23/2016 05:27 PM, Fam Zheng wrote:
> On Tue, 02/23 19:17, John Snow wrote:
>> During incremental backups, if the target has a cluster size that is
>> larger than the backup cluster size and we are backing up to a target
>> that cannot (for whichever reason) pull clusters up from a backing image,
>> we may inadvertantly create unusable incremental backup images.
>>

>> +    /* If there is no backing file on the target, we cannot rely on COW if 
>> our
>> +     * backup cluster size is smaller than the target cluster size. Even for
>> +     * targets with a backing file, try to avoid COW if possible. */
>> +    ret = bdrv_get_info(job->target, &bdi);
>> +    if (ret < 0 && !target->backing) {
>> +        error_setg_errno(errp, -ret,
>> +            "Can't determine cluster size of target that has no backing 
>> file. "
>> +            "This may create an unusable destination image. Aborting.");
> 
> Most error messages don't end with a period, but that's not a hard rule 
> AFAICT.

Ah, but it is:

include/qapi/error.h:

 * The resulting message should be a single phrase, with no newline or
 * trailing punctuation.
 * Please don't error_setg(&error_fatal, ...), use error_report() and
 * exit(), because that's more obvious.
 * Likewise, don't error_setg(&error_abort, ...), use assert().
 */
#define error_setg(errp, fmt, ...)                              \

The error message should be "Can't determine cluster size of target
without backing file"; everything else should be done with
error_append_hint(&errp, "Aborting, since this may create an unusable
destination image\n")


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]