[libvirt] [PATCH] Use unsigned timeout in cmdMigrateSetMaxDowntime

John Ferlan jferlan at redhat.com
Mon Jul 10 11:41:34 UTC 2017



On 06/27/2017 11:19 AM, Scott Garfinkle wrote:
> 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 at us.ibm.com>
> ---
>  tools/virsh-domain.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

"For some commands" allowing a -1 provides a mechanism to set an almost
infinite time without having to type such a large value.  Still in this
case since, the "downtime < 1" check immediately follows it seems that
wouldn't be the case here!

Looking at QEMU code briefly - I do note the QEMU set downtime (and
speed) commands that end up getting called are listed as "deprecated" in
favor of migrate-set-parameters (downtime-limit and max-bandwidth, since
QEMU 2.8).  So while you're at thinking about a getmaxdowntime type
functionality maybe you'd want to give that a go as well (of course
you'd have to add capabilities to detect when it was implemented using
set-parameters)...

In any case,

Reviewed-by: John Ferlan <jferlan at redhat.com>

I'll push in a bit...

Tks -

John




More information about the libvir-list mailing list