Re: [PATCH 04/11] qemu_security: Kill code duplication

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

 



On Wed, Feb 08, 2017 at 14:59:13 +0100, Martin Kletzander wrote:
> On Wed, Feb 08, 2017 at 02:37:48PM +0100, Michal Privoznik wrote:
> > On 02/08/2017 01:43 PM, Peter Krempa wrote:

[...]

> 
> How about simply:
> 
> int
> qemuNamespaceMountTransactionStart(virDomainObjPtr vm,
>                                   virSecurityManagerPtr secMgr)
> {
>    if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT) &&
>        virSecurityManagerTransactionStart(secMgr) < 0)
>        return -1;
> 
>    return 0;
> }
> 
> int
> qemuNamespaceMountTransactionCommit(virDomainObjPtr vm,
>                                    virSecurityManagerPtr secMgr)
> {
>    if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT) &&
>        virSecurityManagerTransactionCommit(secMgr, vm->pid) < 0)
>        return -1;
> 
>    return 0;
> }
> 
> void
> qemuNamespaceMountTransactionAbort(virSecurityManagerPtr secMgr)
> {
>    virSecurityManagerTransactionAbort(secMgr);
> }
> 
> or anything similar with the naming being done by someone else than me.
> 
> You can also extract the securityManager out of the vm pointer if you
> want to make it even shorter.

Yes, this is exactly what I wanted to say in the parallel reply :)

Attachment: signature.asc
Description: PGP 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