[libvirt] [PATCH v2] openvzDomainSetNetwork: use virCommand

Michal Privoznik mprivozn at redhat.com
Mon May 20 13:49:52 UTC 2013


On 20.05.2013 15:47, Michal Privoznik wrote:
> Currently, the openvzDomainSetNetwork function constructs an
> array of strings representing a command line for VZCTL binary.
> This is a overkill since our virCommand APIs can cover all the
> functionality. Moreover, the function is not following our
> structure where return value is set to -1 initially, and after
> all operations succeeded then it is set to zero.
> ---
>  src/openvz/openvz_driver.c | 80 +++++++++++-----------------------------------
>  1 file changed, 19 insertions(+), 61 deletions(-)
> 

D'oh! Hit 'Send' before compilation ended. Consider this as squashed in:


diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index d46baab..d8f7945 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -868,7 +868,7 @@ openvzDomainSetNetwork(virConnectPtr conn, const char *vpsid,
             if (net->ifname == NULL) {
                virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                               _("Could not generate veth name"));
-               goto cleaup;
+               goto cleanup;
             }
         }
 
@@ -906,7 +906,7 @@ openvzDomainSetNetwork(virConnectPtr conn, const char *vpsid,
     /* TODO: processing NAT and physical device */
 
     virCommandAddArg(cmd, "--save");
-    ret = virCommandRun(cmd, NULL);
+    rc = virCommandRun(cmd, NULL);
 
  cleanup:
     virCommandFree(cmd);




More information about the libvir-list mailing list