[libvirt] [PATCH 2/3] Simplify qemuSetupChrSourceCgroup and its callers

Ján Tomko jtomko at redhat.com
Mon Nov 23 12:58:49 UTC 2015


On Fri, Nov 20, 2015 at 09:42:43AM -0500, John Ferlan wrote:
> 
> 
> On 11/20/2015 05:04 AM, Ján Tomko wrote:
> > The domain definition is not needed in any of these functions.
> > Only pass it to qemuSetupChardevCgroup, which is used as a callback
> > for virDomainChrDefForeach.
> > 
> > Use the right type for passing virDomainObjPtr instead of
> > void* where possible.
> > ---
> >  src/qemu/qemu_cgroup.c | 25 ++++++++++---------------
> >  1 file changed, 10 insertions(+), 15 deletions(-)
> > 

...

> > @@ -585,10 +583,7 @@ qemuSetupDevicesCgroup(virQEMUDriverPtr driver,
> >                                 vm) < 0)
> >          goto cleanup;
> >  
> > -    if (vm->def->tpm &&
> > -        (qemuSetupTPMCgroup(vm->def,
> > -                            vm->def->tpm,
> > -                            vm) < 0))
> > +    if (vm->def->tpm && qemuSetupTPMCgroup(vm, vm->def->tpm) < 0)
> 
> Why not just pass "vm"... qemuSetupTPMCgroup could easily deref
> "->def->tpm)"
> 
> ACK - your call if you want to keep/remove the 2nd parameter.
> 

Thanks. I removed the second parameter as well and pushed the series.

Jan

> John
> >          goto cleanup;
> >  
> >      for (i = 0; i < vm->def->nhostdevs; i++) {
> > 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20151123/ad38d57a/attachment-0001.sig>


More information about the libvir-list mailing list