[libvirt] [PATCH v2] qemu: Support copy on read for disk

Osier Yang jyang at redhat.com
Fri Jan 13 02:08:47 UTC 2012


On 2012年01月13日 08:11, Eric Blake wrote:
> On 01/12/2012 03:13 AM, Osier Yang wrote:
>> The new introduced optional attribute "copy_on_read</code>  controls
>> wether to copy read backing file into the image file. The value can
>
> s/wether/whether/
>
>> be either "on" or "off". Copy-on-read avoids accessing the same backing
>> file sectors repeatedly and is useful when the backing file is over a
>> slow network. By default copy-on-read is off.
>> ---
>>   docs/formatdomain.html.in                          |    9 ++++
>>   docs/schemas/domaincommon.rng                      |   11 ++++
>>   src/conf/domain_conf.c                             |   24 +++++++++-
>>   src/conf/domain_conf.h                             |   10 ++++
>>   src/libvirt_private.syms                           |    2 +
>>   src/qemu/qemu_capabilities.c                       |    3 +
>>   src/qemu/qemu_capabilities.h                       |    1 +
>>   src/qemu/qemu_command.c                            |   11 ++++
>>   tests/qemuhelptest.c                               |    3 +-
>>   .../qemuxml2argv-disk-copy_on_read.args            |   11 ++++
>>   .../qemuxml2argv-disk-copy_on_read.xml             |   50 ++++++++++++++++++++
>>   tests/qemuxml2argvtest.c                           |    4 ++
>>   12 files changed, 137 insertions(+), 2 deletions(-)
>>   create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-copy_on_read.args
>>   create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-copy_on_read.xml
>>
>> diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
>> index 42e23a1..3a42ebb 100644
>> --- a/docs/formatdomain.html.in
>> +++ b/docs/formatdomain.html.in
>> @@ -1202,6 +1202,15 @@
>>               <b>In general you should leave this option alone, unless you
>>               are very certain you know what you are doing.</b>
>>             </li>
>> +<li>
>> +            The optional<code>copy_on_read</code>  attribute controls
>> +            wether to copy read backing file into the image file. The
>> +            value can be either "on" or "off".
>> +            Copy-on-read avoids accessing the same backing file sectors
>> +            repeatedly and is useful when the backing file is over a slow
>> +            network. By default copy-on-read is off.
>> +<span class='since'>Since 0.9.9 (QEMU and KVM only)</span>
>
> 0.9.10
>
>> +++ b/docs/schemas/domaincommon.rng
>> @@ -958,6 +958,9 @@
>>         <optional>
>>           <ref name="event_idx"/>
>>         </optional>
>> +<optional>
>> +<ref name="copy_on_read"/>
>> +</optional>
>
> Your placement as an attribute of<driver>  makes sense - the guest sees
> no difference in behavior, so this really is an option for just how the
> host behaves.
>
> Looks pretty clean.  ACK with the minor doc nit fixed.
>

Thanks, Pushed.

Osier




More information about the libvir-list mailing list