Re: [libvirt] [PATCH v2] Implement CPU topology support for QEMU driver

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

 



On Sun, Jan 17, 2010 at 12:57:12 +0000, Daniel P. Berrange wrote:
> > @@ -2112,8 +2148,13 @@ int qemudBuildCommandLine(virConnectPtr conn,
> >          ADD_ARG_LIT("-mem-path");
> >          ADD_ARG_LIT(driver->hugepage_path);
> >      }
> > +
> > +    if (!(smp = qemudBuildCommandLineSmp(conn, def, qemuCmdFlags)))
> > +        goto error;
> > +
> >      ADD_ARG_LIT("-smp");
> > -    ADD_ARG_LIT(vcpus);
> > +    ADD_ARG_LIT(smp);
> > +    VIR_FREE(smp);
> 
> 
> If you've got an allocated string, then just use 'ADD_ARG(smp)' and which
> avoids the strdup() that ADD_ARG_LIT does and avoids need for VIR_FREE
> too. Also you should move the qemudBuildCommandLineSmp() call to *after*
> the ADD_ARG_LIT("-smp") line, otherwise you can leak 'smp' on OOM handling
> in the ADD_ARG_LIT("-smp") call.
> 
> 
> ACK, if you make that minor memory handling fix before committing

Right. I don't think I have commit rights so I can either send a v3 or someone
else can change it when committing this patch...

Jirka

--
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]