[libvirt] [PATCH v3 2/3] network: allow to specify timeout for openvswitch calls

Boris Fiuczynski fiuczy at linux.vnet.ibm.com
Thu Feb 9 15:43:00 UTC 2017


On 02/09/2017 09:01 AM, Michal Privoznik wrote:
>> +    if (virAsprintf(&ovs_timeout, "--timeout=%d", virNetDevOpenvswitchTimeout) < 0)
>> +        goto cleanup;
>>
>>      cmd = virCommandNew(OVSVSCTL);
>>
>> -    virCommandAddArgList(cmd, "--timeout=5", "--", "--if-exists", "del-port",
>> +    virCommandAddArgList(cmd, ovs_timeout, "--", "--if-exists", "del-port",
>>                           ifname, "--", "add-port", brname, ifname, NULL);
> While this would work we have virCommandAddArgFormat which wraps exactly this:
> virCommandNew(OVSVSCTL);
> virCommandAddArgFormat(cmd, "--timeout=%u", virNetDevOpenvswitchTimeout);
> virCommandAddArgList(cmd, "--", "--if-exists", ..., NULL);
>
> Then we can take the extra step and wrap it in a static function so that --timeout=%u doesn't have to be copied all over the place.
>
> I will fix this before pushing.
Thanks and the wrapper is a good idea.

>
> ACK with the change I'm suggesting.
>
> Michal
>


-- 
Mit freundlichen Grüßen/Kind regards
    Boris Fiuczynski

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martina Köderitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294




More information about the libvir-list mailing list