Re: [PATCH V2 1/2] Fix building domain def in securityselinuxtest

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

 



On Wed, Aug 16, 2017 at 05:54:07PM -0600, Jim Fehlig wrote:
> The virDomainDef created by testBuildDomainDef in securityselinuxtest
> adds a seclabel but does not increment nseclabels. Also, it should
> populate seclabel->model with 'selinux'.
>
> While at it, use the secdef itself to populate values instead of
> the indirection through def->seclabels[0].
>
> Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx>
> ---
>  tests/securityselinuxtest.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/tests/securityselinuxtest.c b/tests/securityselinuxtest.c
> index 767b6cc02..f6143fb06 100644
> --- a/tests/securityselinuxtest.c
> +++ b/tests/securityselinuxtest.c
> @@ -73,24 +73,28 @@ testBuildDomainDef(bool dynamic,
>      if (!(def = virDomainDefNew()))
>          goto error;
>
> +    def->virtType = VIR_DOMAIN_VIRT_KVM;
>      if (VIR_ALLOC_N(def->seclabels, 1) < 0)
>          goto error;
>
> +    def->nseclabels++;

Personally, I'd put the increment after assigning secdef to the domain
definition, but the memory chunk is zeroed out, so it doesn't matter at all.

ACK

Erik

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