Re: [PATCH 4/9] qemu: Move qemuCaps host CPU data in a struct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 13, 2017 at 03:32:53PM +0200, Jiri Denemark wrote:
> We need to store several CPU related data structure for both KVM and
> TCG. So instead of keeping two different copies of everything let's
> make a virQEMUCapsHostCPUData struct and use it twice.
> 
> Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
> ---
>  src/qemu/qemu_capabilities.c | 166 +++++++++++++++++++++----------------------
>  1 file changed, 81 insertions(+), 85 deletions(-)
> 
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 6f0d6287e..f914154be 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c

[...]

> @@ -2143,17 +2141,12 @@ virQEMUCapsHostCPUDataCopy(virQEMUCapsPtr dst,
>  
>  
>  static void
> -virQEMUCapsHostCPUDataClear(virQEMUCapsPtr qemuCaps)
> +virQEMUCapsHostCPUDataClear(virQEMUCapsHostCPUDataPtr cpuData)
>  {
> -    qemuMonitorCPUModelInfoFree(qemuCaps->kvmCPUModelInfo);
> -    qemuMonitorCPUModelInfoFree(qemuCaps->tcgCPUModelInfo);
> -    qemuCaps->kvmCPUModelInfo = NULL;
> -    qemuCaps->tcgCPUModelInfo = NULL;
> +    qemuMonitorCPUModelInfoFree(cpuData->info);
> +    virCPUDefFree(cpuData->reported);
>  
> -    virCPUDefFree(qemuCaps->kvmCPUModel);
> -    virCPUDefFree(qemuCaps->tcgCPUModel);
> -    qemuCaps->kvmCPUModel = NULL;
> -    qemuCaps->tcgCPUModel = NULL;
> +    memset(cpuData, '\0', sizeof(*cpuData));

We tend to use memset(ptr, 0, size); :)

>  }
>  
>  

ACK

Pavel

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux