]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: Reuse existing variable when parsing migrate --disks-port
authorMartin Kletzander <mkletzan@redhat.com>
Mon, 24 Aug 2020 13:43:50 +0000 (15:43 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Fri, 4 Sep 2020 08:20:49 +0000 (10:20 +0200)
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
tools/virsh-domain.c

index 36581d2c31d2f75f157d5d60788f555fc0687de3..8a4a0d172dc9405dfb4bbb842b12ae8516252aa7 100644 (file)
@@ -10708,7 +10708,6 @@ doMigrate(void *opaque)
     virDomainPtr dom = NULL;
     const char *desturi = NULL;
     const char *opt = NULL;
-    int disksPort = 0;
     unsigned int flags = 0;
     virshCtrlData *data = opaque;
     vshControl *ctl = data->ctl;
@@ -10756,11 +10755,11 @@ doMigrate(void *opaque)
                                 VIR_MIGRATE_PARAM_LISTEN_ADDRESS, opt) < 0)
         goto save_error;
 
-    if (vshCommandOptInt(ctl, cmd, "disks-port", &disksPort) < 0)
+    if (vshCommandOptInt(ctl, cmd, "disks-port", &intOpt) < 0)
         goto out;
-    if (disksPort &&
+    if (intOpt &&
         virTypedParamsAddInt(&params, &nparams, &maxparams,
-                             VIR_MIGRATE_PARAM_DISKS_PORT, disksPort) < 0)
+                             VIR_MIGRATE_PARAM_DISKS_PORT, intOpt) < 0)
         goto save_error;
 
     if (vshCommandOptStringReq(ctl, cmd, "dname", &opt) < 0)