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

Jim Fehlig jfehlig at suse.com
Mon Aug 21 15:39:37 UTC 2017


On 08/17/2017 01:55 AM, Erik Skultety wrote:
> 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 at suse.com>
>> ---
>>   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.

I prefer it after the assignment too and moved it there.


> ACK

Thanks! Pushed now.

Regards,
Jim




More information about the libvir-list mailing list