[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 43/47] mirror: allow customizing the granularity
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 43/47] mirror: allow customizing the granularity |
Date: |
Mon, 30 Jul 2012 16:03:58 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 |
Il 30/07/2012 15:53, Eric Blake ha scritto:
> On 07/30/2012 07:40 AM, Paolo Bonzini wrote:
>> Il 28/07/2012 15:43, Eric Blake ha scritto:
>>>>> + if (granularity < 512 || granularity > 1048576 * 64) {
>>>>> + error_set(errp, QERR_INVALID_PARAMETER, device);
>>>>> + return;
>>>>> + }
>>>>> + if (granularity & (granularity - 1)) {
>>>>> + error_set(errp, QERR_INVALID_PARAMETER, device);
>>>>> + return;
>>> In the XBZLRE migration series, we decided to round the users input down
>>> to a power of two instead of reject it. Should we do that here?
>>
>> I can certainly do that, but do you have a pointer to the discussion so
>> that I can understand the rationale?
>
> https://lists.gnu.org/archive/html/qemu-devel/2012-05/msg02421.html
Hmm, a buffer size (the cache size in the case of XBZRLE) is different
however. There is no reason in principle why it needs to be a power of
two (except if you know how the hash table is implemented, or something
like that). For example, the buf_size argument in this series does
indeed support a non-power-of-two size.
Requesting a granularity to be a power-of-two shouldn't be surprising to
anybody who has an idea of what a bit shift is and how it is used...
Paolo
- Re: [Qemu-devel] [PATCH 28/47] qmp: add drive-mirror command, (continued)
- [Qemu-devel] [PATCH 21/47] block: add bdrv_ensure_backing_file, Paolo Bonzini, 2012/07/24
- [Qemu-devel] [PATCH 35/47] qemu-iotests: add testcases for mirroring on-source-error/on-target-error, Paolo Bonzini, 2012/07/24
- [Qemu-devel] [PATCH 24/47] block: introduce new dirty bitmap functionality, Paolo Bonzini, 2012/07/24
- [Qemu-devel] [PATCH 45/47] mirror: add buf-size argument to drive-mirror, Paolo Bonzini, 2012/07/24
- [Qemu-devel] [PATCH 25/47] block: add block-job-complete, Paolo Bonzini, 2012/07/24
- [Qemu-devel] [PATCH 43/47] mirror: allow customizing the granularity, Paolo Bonzini, 2012/07/24
[Qemu-devel] [PATCH 44/47] mirror: switch mirror_iteration to AIO, Paolo Bonzini, 2012/07/24
[Qemu-devel] [PATCH 38/47] block: implement dirty bitmap using HBitmap, Paolo Bonzini, 2012/07/24
Re: [Qemu-devel] [PATCH 00/47] Block job improvements for 1.2, Eric Blake, 2012/07/28