[libvirt PATCH] cpu: Properly define g_autoptr for virCPUData

Jiri Denemark posted 1 patch 3 years, 11 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/c7494e190a593ad8986c50f67f38835534d9dcc9.1589532404.git.jdenemar@redhat.com
src/cpu/cpu.h     | 1 +
src/cpu/cpu_x86.c | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
[libvirt PATCH] cpu: Properly define g_autoptr for virCPUData
Posted by Jiri Denemark 3 years, 11 months ago
The structure is not specific to x86 and thus its cleanup function
should be defined in cpu.h and be available to all users.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/cpu/cpu.h     | 1 +
 src/cpu/cpu_x86.c | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h
index f779d2be17..1d7900a829 100644
--- a/src/cpu/cpu.h
+++ b/src/cpu/cpu.h
@@ -182,6 +182,7 @@ virCPUDataNew(virArch arch);
 
 void
 virCPUDataFree(virCPUDataPtr data);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUData, virCPUDataFree);
 
 bool
 virCPUGetHostIsSupported(virArch arch);
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 9183259bce..e3c553e943 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -495,7 +495,6 @@ virCPUx86DataFree(virCPUDataPtr data)
     virCPUx86DataClear(&data->data.x86);
     VIR_FREE(data);
 }
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUData, virCPUx86DataFree);
 
 
 static void
-- 
2.26.2

Re: [libvirt PATCH] cpu: Properly define g_autoptr for virCPUData
Posted by Michal Privoznik 3 years, 11 months ago
On 5/15/20 10:46 AM, Jiri Denemark wrote:
> The structure is not specific to x86 and thus its cleanup function
> should be defined in cpu.h and be available to all users.
> 
> Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
> ---
>   src/cpu/cpu.h     | 1 +
>   src/cpu/cpu_x86.c | 1 -
>   2 files changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal