Re: [PATCH 1/3] vmx: Use the allocator virDomainChrDefNew

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

 



On Fri, Oct 21, 2016 at 09:01:42AM -0400, John Ferlan wrote:
> Rather than VIR_ALLOC of the virDomainChrDefPtr
> 
> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> ---
>  src/vmx/vmx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
> index fc4347f..f61c4d6 100644
> --- a/src/vmx/vmx.c
> +++ b/src/vmx/vmx.c
> @@ -2758,7 +2758,7 @@ virVMXParseSerial(virVMXContext *ctx, virConfPtr conf, int port,
>          return -1;
>      }
>  
> -    if (VIR_ALLOC(*def) < 0)
> +    if (!(*def = virDomainChrDefNew(NULL)))
>          return -1;
>  
>      (*def)->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL;
> @@ -2946,7 +2946,7 @@ virVMXParseParallel(virVMXContext *ctx, virConfPtr conf, int port,
>          return -1;
>      }
>  
> -    if (VIR_ALLOC(*def) < 0)
> +    if (!(*def = virDomainChrDefNew(NULL)))
>          return -1;
>  
>      (*def)->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL;
> -- 

You've missed those two occurrences:
    src/conf/domain_conf.c:3876            if (VIR_ALLOC(def->consoles[0]) < 0)
    src/conf/domain_conf.c:3891        if (VIR_ALLOC(chr) < 0)

I've found those because virt-aa-helper-test was crashing after applying the
next patch.  Because this is a generic code for all drivers we need to pass
xmlopt to allocate the privateData.

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]