[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH RFC v3 03/11] KVM: Fixup kvm_log_clear_one_slot() ioctl retur
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH RFC v3 03/11] KVM: Fixup kvm_log_clear_one_slot() ioctl return check |
Date: |
Sun, 24 May 2020 18:39:25 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 5/24/20 1:20 AM, Peter Xu wrote:
> kvm_vm_ioctl() handles the errno trick already for ioctl() on
> returning -1 for errors. Fix this.
>
> Reviewed-by: Dr. David Alan Gilbert <address@hidden>
> Signed-off-by: Peter Xu <address@hidden>
> ---
> accel/kvm/kvm-all.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
> index d06cc04079..6e015aa2d4 100644
> --- a/accel/kvm/kvm-all.c
> +++ b/accel/kvm/kvm-all.c
> @@ -699,14 +699,13 @@ static int kvm_log_clear_one_slot(KVMSlot *mem, int
> as_id, uint64_t start,
> d.num_pages = bmap_npages;
> d.slot = mem->slot | (as_id << 16);
>
> - if (kvm_vm_ioctl(s, KVM_CLEAR_DIRTY_LOG, &d) == -1) {
> - ret = -errno;
> + ret = kvm_vm_ioctl(s, KVM_CLEAR_DIRTY_LOG, &d);
> + if (ret) {
> error_report("%s: KVM_CLEAR_DIRTY_LOG failed, slot=%d, "
> "start=0x%"PRIx64", size=0x%"PRIx32", errno=%d",
> __func__, d.slot, (uint64_t)d.first_page,
> (uint32_t)d.num_pages, ret);
> } else {
> - ret = 0;
> trace_kvm_clear_dirty_log(d.slot, d.first_page, d.num_pages);
> }
>
>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
- [PATCH RFC v3 00/11] KVM: Dirty ring support (QEMU part), Peter Xu, 2020/05/23
- [PATCH RFC v3 01/11] linux-headers: Update, Peter Xu, 2020/05/23
- [PATCH RFC v3 03/11] KVM: Fixup kvm_log_clear_one_slot() ioctl return check, Peter Xu, 2020/05/23
- Re: [PATCH RFC v3 03/11] KVM: Fixup kvm_log_clear_one_slot() ioctl return check,
Philippe Mathieu-Daudé <=
- [PATCH RFC v3 02/11] memory: Introduce log_sync_global() to memory listener, Peter Xu, 2020/05/23
- [PATCH RFC v3 04/11] KVM: Use a big lock to replace per-kml slots_lock, Peter Xu, 2020/05/23
- [PATCH RFC v3 05/11] KVM: Create the KVMSlot dirty bitmap on flag changes, Peter Xu, 2020/05/23
- [PATCH RFC v3 06/11] KVM: Provide helper to get kvm dirty log, Peter Xu, 2020/05/23
- [PATCH RFC v3 07/11] KVM: Provide helper to sync dirty bitmap from slot to ramblock, Peter Xu, 2020/05/23
- [PATCH RFC v3 08/11] KVM: Simplify dirty log sync in kvm_set_phys_mem, Peter Xu, 2020/05/23
- [PATCH RFC v3 09/11] KVM: Cache kvm slot dirty bitmap size, Peter Xu, 2020/05/23
- [PATCH RFC v3 10/11] KVM: Add dirty-gfn-count property, Peter Xu, 2020/05/23
- [PATCH RFC v3 11/11] KVM: Dirty ring support, Peter Xu, 2020/05/23
- Re: [PATCH RFC v3 00/11] KVM: Dirty ring support (QEMU part), Peter Xu, 2020/05/24