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

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

 



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

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