[PATCH] linux-headers: change the annotation of VFIO_IOMMU_SPAPR_REGISTER_MEMORY in vfio.h

2024-04-11 Thread JianChunfu
The ioctl(VFIO_IOMMU_MAP_DMA/VFIO_IOMMU_UNMAP_DMA) won't be called in SPAPR machine, which is replaced by VFIO_IOMMU_SPAPR_TCE_CREATE/ VFIO_IOMMU_SPAPR_TCE_REMOVE, so change the description. Signed-off-by: JianChunfu --- linux-headers/linux/vfio.h | 2 +- 1 file changed, 1 insertion(

[RESEND PATCH] target/ppc: Fix the order of kvm_enable judgment about kvmppc_set_interrupt()

2023-08-28 Thread jianchunfu
It's unnecessary for non-KVM accelerators(TCG, for example), to call this function, so change the order of kvm_enable() judgment. The static inline function that returns -1 directly does not work in TCG's situation. Signed-off-by: jianchunfu --- hw/ppc/ppc.c | 8 ++-- target

[PATCH] target/ppc: Fix the order of kvm_enable judgment about kvmppc_set_interrupt()

2023-07-21 Thread jianchunfu
It's unnecessary for non-KVM accelerators(TCG, for example), to call this function, so change the order of kvm_enable() judgment. The static inline function that returns -1 directly does not work in TCG's situation. Signed-off-by: jianchunfu --- hw/ppc/ppc.c | 8 ++-- target

[RFC] libvhost-user: Add report when allocation failures

2022-11-09 Thread jianchunfu
Add error report when malloc fails of virtqueue element. It's a little pointless to return NULL, wouldn't it be right to report error and exit when malloc fails since it is in a standalone project while not QEMU. Signed-off-by: jianchunfu --- subprojects/libvhost-user/libvhost-

[PATCH] libvhost-user: Handling potential memory allocation failures

2022-11-08 Thread jianchunfu
Add malloc check of virtqueue element in libvhost-user. Signed-off-by: jianchunfu --- subprojects/libvhost-user/libvhost-user.c | 4 1 file changed, 4 insertions(+) diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c index 47d2efc60f

[PATCH] bochs-display: Modify mismatched return value

2022-09-14 Thread jianchunfu
Modify the return value of unsigned int to 0. Signed-off-by: jianchunfu --- hw/display/bochs-display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/bochs-display.c b/hw/display/bochs-display.c index 8ed734b195..3bd22b4ea7 100644 --- a/hw/display/bochs-display.c

[PATCH] target/ppc: Add error reporting when opening file fails

2022-06-28 Thread jianchunfu
Add error reporting before return when opening file fails. Signed-off-by: jianchunfu --- target/ppc/kvm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index dc93b99189..ef9a871411 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -1798,6

[PATCH] migration/dirtyrate: Replace malloc with g_new

2022-04-11 Thread jianchunfu
Using macro g_new() to handling potential memory allocation failures in dirtyrate. Signed-off-by: jianchunfu --- migration/dirtyrate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c index aace12a787..0e59aacbb0 100644 --- a

[RFC] migration/dirtyrate: check malloc() return

2022-04-09 Thread jianchunfu
Handling potential memory allocation failures in dirtyrate. Signed-off-by: jianchunfu --- migration/dirtyrate.c | 8 1 file changed, 8 insertions(+) diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c index aace12a787..5dd40f32c8 100644 --- a/migration/dirtyrate.c +++ b