From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biCEL-0002nr-Uz for qemu-devel@nongnu.org; Thu, 08 Sep 2016 23:11:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1biCEG-00045E-Sl for qemu-devel@nongnu.org; Thu, 08 Sep 2016 23:11:53 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:58868) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biCEG-00044U-Mu for qemu-devel@nongnu.org; Thu, 08 Sep 2016 23:11:48 -0400 References: <1473350399-29210-1-git-send-email-ashijeetacharya@gmail.com> From: Eric Blake Message-ID: <96b5fe74-f05d-b7e0-e7be-b5f8a79c2ced@redhat.com> Date: Thu, 8 Sep 2016 22:11:40 -0500 MIME-Version: 1.0 In-Reply-To: <1473350399-29210-1-git-send-email-ashijeetacharya@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v4] Move max-bandwidth and downtime-limit into migrate_set_parameter for both hmp and qmp List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ashijeet Acharya , lcapitulino@redhat.com Cc: quintela@redhat.com, amit.shah@redhat.com, armbru@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, berrange@redhat.com, qemu-devel@nongnu.org On 09/08/2016 10:59 AM, Ashijeet Acharya wrote: > Mark old-commands for speed and downtime as deprecated. > Move max-bandwidth and downtime-limit into migrate-set-parameters for > setting maximum migration speed and expected downtime limit parameters > respectively. > Change downtime units to milliseconds (only for new-command) and update > the query part in both hmp and qmp qemu control interfaces. > > Signed-off-by: Ashijeet Acharya > --- > +void qmp_migrate_set_speed(int64_t valuebw, Error **errp) > +{ > + bool has_compress_level = false; > + bool has_compress_threads = false; > + bool has_decompress_threads = false; > + bool has_cpu_throttle_initial = false; > + bool has_cpu_throttle_increment = false; > + bool has_tls_creds = false; > + bool has_tls_hostname = false; > + bool has_max_bandwidth = true; > + bool has_downtime_limit = false; > + const char *valuestr = NULL; > + long valueint = 0; > + Error *err = NULL; > + > + qmp_migrate_set_parameters(has_compress_level, valueint, > + has_compress_threads, valueint, > + has_decompress_threads, valueint, > + has_cpu_throttle_initial, valueint, > + has_cpu_throttle_increment, valueint, > + has_tls_creds, valuestr, > + has_tls_hostname, valuestr, > + has_max_bandwidth, valuebw, > + has_downtime_limit, valueint, > + &err); > + > +} Oh, and I was so caught up on the grossness of this method that I failed to overlook that you are silently ignoring and leaking any errors. Since you aren't making any further decisions, you don't need the 'Error *err' declaration, and can just pass 'errp' instead of '&err' to qmp_migrate_set_parameters(). At any rate, I'm also posting my proposal to make this patch have a simpler back-compat method, by using qapi boxed parameters of my series. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org