[libvirt] [PATCH] qemu_domain: Drop namespace check from top level functions

John Ferlan jferlan at redhat.com
Tue Sep 11 21:11:00 UTC 2018



On 09/07/2018 08:05 AM, Michal Privoznik wrote:
> In some cases we are checking if the mount namespace is enabled
> at two places: one is at the beginning of exported function (e.g.
> qemuDomainNamespaceSetupDisk()) and the other is at the beginning
> of qemuDomainNamespaceMknodPaths() which is called from the
> former function anyway. Then we have some other functions which
> rely on the later check solely.
> 
> In order to compensate for possibly needles function call,

needless

> qemuDomainNamespaceMknodPaths() returns early if @npaths is zero.
> 
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>  src/qemu/qemu_domain.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
> 

Even though my personal preference for npaths == 0, what's here is
consistent with the same check in qemuDomainNamespaceUnlinkPaths.

Reviewed-by: John Ferlan <jferlan at redhat.com>

John




More information about the libvir-list mailing list