[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RFC 1/9] KVM: Fixup kvm_log_clear_one_slot() ioctl return check
From: |
Peter Xu |
Subject: |
[PATCH RFC 1/9] KVM: Fixup kvm_log_clear_one_slot() ioctl return check |
Date: |
Wed, 5 Feb 2020 09:17:41 -0500 |
kvm_vm_ioctl() handles the errno trick already for ioctl() on
returning -1 for errors. Fix this.
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 c111312dfd..4be3cd2352 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -688,14 +688,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);
}
--
2.24.1
- [PATCH RFC 0/9] KVM: Dirty ring support (QEMU part), Peter Xu, 2020/02/05
- [PATCH RFC 1/9] KVM: Fixup kvm_log_clear_one_slot() ioctl return check,
Peter Xu <=
- [PATCH RFC 3/9] memory: Introduce log_sync_global() to memory listener, Peter Xu, 2020/02/05
- [PATCH RFC 2/9] linux-headers: Update, Peter Xu, 2020/02/05
- [PATCH RFC 4/9] KVM: Create the KVMSlot dirty bitmap on flag changes, Peter Xu, 2020/02/05
- [PATCH RFC 6/9] KVM: Provide helper to sync dirty bitmap from slot to ramblock, Peter Xu, 2020/02/05
- [PATCH RFC 7/9] KVM: Cache kvm slot dirty bitmap size, Peter Xu, 2020/02/05
- [PATCH RFC 5/9] KVM: Provide helper to get kvm dirty log, Peter Xu, 2020/02/05
- [PATCH RFC 8/9] KVM: Add dirty-ring-size property, Peter Xu, 2020/02/05
- [PATCH RFC 9/9] KVM: Dirty ring support, Peter Xu, 2020/02/05
- Re: [PATCH RFC 0/9] KVM: Dirty ring support (QEMU part), no-reply, 2020/02/05