From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38546 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Om0BL-00009W-3L for qemu-devel@nongnu.org; Thu, 19 Aug 2010 04:09:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Olzz3-0000fe-M0 for qemu-devel@nongnu.org; Thu, 19 Aug 2010 03:56:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25797) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Olzz3-0000fa-Fa for qemu-devel@nongnu.org; Thu, 19 Aug 2010 03:56:21 -0400 Message-ID: <4C6CE3A0.80802@redhat.com> Date: Thu, 19 Aug 2010 09:56:16 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] balloon: Don't try fetching info if machine is stopped List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: Juan Quintela , qemu list , agl@us.ibm.com On 08/19/2010 06:14 AM, Amit Shah wrote: > + get_cached_data = 0; > + if (!vm_running) { > + get_cached_data = 1; > + } get_cached_data = !vm_running; Alternatively, see below... > + ret = qemu_balloon_status(cb, opaque, get_cached_data); > if (!ret) { Piggybacking on the existing coding style thread, here ret = qemu_balloon_status(cb, opaque, !vm_running); would be quite hard to read indeed. Maybe we can use something like this: ret = qemu_balloon_status(cb, opaque, /*get_cached_data=*/ !vm_running); ? Paolo