[Qemu-devel] [PATCH 0/4] block: Trivial fixes in offloading code

Fam Zheng posted 4 patches 7 years, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180702025836.20957-1-famz@redhat.com
Test checkpatch passed
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test s390x passed
block/file-posix.c | 2 +-
block/qcow2.c      | 3 ---
block/raw-format.c | 2 +-
3 files changed, 2 insertions(+), 5 deletions(-)
[Qemu-devel] [PATCH 0/4] block: Trivial fixes in offloading code
Posted by Fam Zheng 7 years, 4 months ago
These are the low priority ones spotted by Kevin and Max last week.

Fam Zheng (4):
  qcow2: Drop unused cluster_data
  file-posix: Fix fd_open check in raw_co_copy_range_to
  qcow2: Drop unreachable break
  raw: Drop superfluous semicolon

 block/file-posix.c | 2 +-
 block/qcow2.c      | 3 ---
 block/raw-format.c | 2 +-
 3 files changed, 2 insertions(+), 5 deletions(-)

-- 
2.17.1


Re: [Qemu-devel] [PATCH 0/4] block: Trivial fixes in offloading code
Posted by Max Reitz 7 years, 4 months ago
On 2018-07-02 04:58, Fam Zheng wrote:
> These are the low priority ones spotted by Kevin and Max last week.
> 
> Fam Zheng (4):
>   qcow2: Drop unused cluster_data
>   file-posix: Fix fd_open check in raw_co_copy_range_to
>   qcow2: Drop unreachable break
>   raw: Drop superfluous semicolon
> 
>  block/file-posix.c | 2 +-
>  block/qcow2.c      | 3 ---
>  block/raw-format.c | 2 +-
>  3 files changed, 2 insertions(+), 5 deletions(-)

Thanks, applied to my block branch:

https://git.xanclic.moe/XanClic/qemu/commits/branch/block


Do you want to make qcow2_co_copy_range_to() do something special on
BDRV_REQ_ZERO_WRITE?  To me, it seems natural, but on the other hand
maybe it wouldn't bring anything.  If the protocol layer supports copy
offloading, then it'll probably do that zero write efficiently anyway.
If it doesn't, qemu-img convert will just fall back to the usual
implementation which involves writing zeroes when zeroes are read, so...
 What's your opinion?

Max

Re: [Qemu-devel] [PATCH 0/4] block: Trivial fixes in offloading code
Posted by Fam Zheng 7 years, 4 months ago
On Mon, 07/02 14:35, Max Reitz wrote:
> On 2018-07-02 04:58, Fam Zheng wrote:
> > These are the low priority ones spotted by Kevin and Max last week.
> > 
> > Fam Zheng (4):
> >   qcow2: Drop unused cluster_data
> >   file-posix: Fix fd_open check in raw_co_copy_range_to
> >   qcow2: Drop unreachable break
> >   raw: Drop superfluous semicolon
> > 
> >  block/file-posix.c | 2 +-
> >  block/qcow2.c      | 3 ---
> >  block/raw-format.c | 2 +-
> >  3 files changed, 2 insertions(+), 5 deletions(-)
> 
> Thanks, applied to my block branch:
> 
> https://git.xanclic.moe/XanClic/qemu/commits/branch/block
> 
> 
> Do you want to make qcow2_co_copy_range_to() do something special on
> BDRV_REQ_ZERO_WRITE?  To me, it seems natural, but on the other hand
> maybe it wouldn't bring anything.  If the protocol layer supports copy
> offloading, then it'll probably do that zero write efficiently anyway.
> If it doesn't, qemu-img convert will just fall back to the usual
> implementation which involves writing zeroes when zeroes are read, so...
>  What's your opinion?

In bdrv_co_copy_range_internal() there is

    if (flags & BDRV_REQ_ZERO_WRITE) {
        return bdrv_co_pwrite_zeroes(dst, dst_offset, bytes, flags);
    }

before calling driver .bdrv_co_copy_range_to() callback. I think this is enough?

Fam

Re: [Qemu-devel] [PATCH 0/4] block: Trivial fixes in offloading code
Posted by Max Reitz 7 years, 4 months ago
On 2018-07-03 03:26, Fam Zheng wrote:
> On Mon, 07/02 14:35, Max Reitz wrote:
>> On 2018-07-02 04:58, Fam Zheng wrote:
>>> These are the low priority ones spotted by Kevin and Max last week.
>>>
>>> Fam Zheng (4):
>>>   qcow2: Drop unused cluster_data
>>>   file-posix: Fix fd_open check in raw_co_copy_range_to
>>>   qcow2: Drop unreachable break
>>>   raw: Drop superfluous semicolon
>>>
>>>  block/file-posix.c | 2 +-
>>>  block/qcow2.c      | 3 ---
>>>  block/raw-format.c | 2 +-
>>>  3 files changed, 2 insertions(+), 5 deletions(-)
>>
>> Thanks, applied to my block branch:
>>
>> https://git.xanclic.moe/XanClic/qemu/commits/branch/block
>>
>>
>> Do you want to make qcow2_co_copy_range_to() do something special on
>> BDRV_REQ_ZERO_WRITE?  To me, it seems natural, but on the other hand
>> maybe it wouldn't bring anything.  If the protocol layer supports copy
>> offloading, then it'll probably do that zero write efficiently anyway.
>> If it doesn't, qemu-img convert will just fall back to the usual
>> implementation which involves writing zeroes when zeroes are read, so...
>>  What's your opinion?
> 
> In bdrv_co_copy_range_internal() there is
> 
>     if (flags & BDRV_REQ_ZERO_WRITE) {
>         return bdrv_co_pwrite_zeroes(dst, dst_offset, bytes, flags);
>     }
> 
> before calling driver .bdrv_co_copy_range_to() callback. I think this is enough?

Ah, right...  Yep, that's enough. :-)

Max

Re: [Qemu-devel] [Qemu-block] [PATCH 0/4] block: Trivial fixes in offloading code
Posted by Stefan Hajnoczi 7 years, 4 months ago
On Mon, Jul 02, 2018 at 10:58:32AM +0800, Fam Zheng wrote:
> These are the low priority ones spotted by Kevin and Max last week.
> 
> Fam Zheng (4):
>   qcow2: Drop unused cluster_data
>   file-posix: Fix fd_open check in raw_co_copy_range_to
>   qcow2: Drop unreachable break
>   raw: Drop superfluous semicolon
> 
>  block/file-posix.c | 2 +-
>  block/qcow2.c      | 3 ---
>  block/raw-format.c | 2 +-
>  3 files changed, 2 insertions(+), 5 deletions(-)
> 
> -- 
> 2.17.1
> 
> 

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>