From mboxrd@z Thu Jan 1 00:00:00 1970 From: Asias He Subject: Re: [RFC 01/12] kvm tools: Split kvm_cmd_run into init, work and uninit Date: Tue, 20 Dec 2011 16:55:31 +0800 Message-ID: <4EF04D83.3020008@gmail.com> References: <1324303114-5948-1-git-send-email-levinsasha928@gmail.com> <1324303114-5948-2-git-send-email-levinsasha928@gmail.com> <1324329976.1428.316.camel@jaguar> <1324375766.22797.0.camel@lappy> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Pekka Enberg , mingo@elte.hu, gorcunov@gmail.com, kvm@vger.kernel.org To: Sasha Levin Return-path: Received: from mail-gx0-f174.google.com ([209.85.161.174]:64600 "EHLO mail-gx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750865Ab1LTI5G (ORCPT ); Tue, 20 Dec 2011 03:57:06 -0500 Received: by ggdk6 with SMTP id k6so4570160ggd.19 for ; Tue, 20 Dec 2011 00:57:06 -0800 (PST) In-Reply-To: <1324375766.22797.0.camel@lappy> Sender: kvm-owner@vger.kernel.org List-ID: On 12/20/2011 06:09 PM, Sasha Levin wrote: > On Mon, 2011-12-19 at 23:26 +0200, Pekka Enberg wrote: >> On Mon, 2011-12-19 at 15:58 +0200, Sasha Levin wrote: >>> +int kvm_cmd_run(int argc, const char **argv, const char *prefix) >>> +{ >>> + int r, ret; >>> + >>> + r = kvm_cmd_run_init(argc, argv); >>> + ret = kvm_cmd_run_work(); >>> + r = kvm_cmd_run_uninit(ret); >>> + >>> + return ret; >>> } >> >> What's going on here? Why do you bother saving 'r' if you don't use it >> for anything? > > It was part of my plans to get kvm_cmd_run_{init, uninit} as a simple Can we have a shorter name for 'uninit', e.g. 'fini', thus we will have {init, fini}. > for(;;) through a init/uninit function pointer array, right now it's > simply meaningless there. > -- Asias He