]> xenbits.xensource.com Git - libvirt.git/commitdiff
Use unsigned timeout in cmdMigrateSetMaxDowntime
authorScott Garfinkle <seg@us.ibm.com>
Tue, 27 Jun 2017 15:19:40 +0000 (10:19 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 10 Jul 2017 14:23:45 +0000 (10:23 -0400)
While looking to implement a migrate-getmaxdowntime command (coming),
I noticed that the setmaxdowntime is incorrectly looking at its
parameter as a signed longlong. Not sure how that got past gcc, but
here's a simple patch to make the command line parsing and the parameter to
the worker functions all have the correct (unsigned) type.

Signed-off-by: Scott Garfinkle <seg@us.ibm.com>
tools/virsh-domain.c

index 8f3d4d50e77a2595963711a3e8004fefeb45b111..06849798450243885ba6b2067c3ff854907fc0ee 100644 (file)
@@ -10696,13 +10696,13 @@ static bool
 cmdMigrateSetMaxDowntime(vshControl *ctl, const vshCmd *cmd)
 {
     virDomainPtr dom = NULL;
-    long long downtime = 0;
+    unsigned long long downtime = 0;
     bool ret = false;
 
     if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
         return false;
 
-    if (vshCommandOptLongLong(ctl, cmd, "downtime", &downtime) < 0)
+    if (vshCommandOptULongLong(ctl, cmd, "downtime", &downtime) < 0)
         goto done;
     if (downtime < 1) {
         vshError(ctl, "%s", _("migrate: Invalid downtime"));