From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NIllP-0006Rf-A7 for qemu-devel@nongnu.org; Thu, 10 Dec 2009 11:21:11 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NIllK-0006Ms-AV for qemu-devel@nongnu.org; Thu, 10 Dec 2009 11:21:10 -0500 Received: from [199.232.76.173] (port=47473 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NIllK-0006MY-0S for qemu-devel@nongnu.org; Thu, 10 Dec 2009 11:21:06 -0500 Received: from e37.co.us.ibm.com ([32.97.110.158]:60563) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NIllK-0007yx-66 for qemu-devel@nongnu.org; Thu, 10 Dec 2009 11:21:06 -0500 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by e37.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id nBAGJlw8011919 for ; Thu, 10 Dec 2009 09:19:47 -0700 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id nBAGKn6D071476 for ; Thu, 10 Dec 2009 09:20:50 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id nBAGKmgu003091 for ; Thu, 10 Dec 2009 09:20:48 -0700 Message-ID: <4B211FDF.4070509@linux.vnet.ibm.com> Date: Thu, 10 Dec 2009 10:20:47 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 10/19] monitor: Convert do_info_name() to QObject References: <1260376078-8694-1-git-send-email-lcapitulino@redhat.com> <1260376078-8694-11-git-send-email-lcapitulino@redhat.com> <20091210095237.38cafe5c@doriath> <4B20F003.6070409@linux.vnet.ibm.com> <4B2119F9.6010003@redhat.com> <4B211BE2.60907@linux.vnet.ibm.com> <4B211D6F.7020906@redhat.com> In-Reply-To: <4B211D6F.7020906@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel@nongnu.org, Markus Armbruster , Luiz Capitulino Avi Kivity wrote: > But we have two null conditions to check for, in an extendible > dictionary: > > 1. The feature is unknown to qemu > 2. The feature is known to qemu, but disabled > > So, "if 'field' in result:" tests the former, and "if > result['field']:" tests the latter. > > In your example, a period of None makes no sense, so it would be > sufficient to > > period = hpet_info.get('period', 0.100) By the same token, wouldn't you probably do: name = hpet_info.get('name', None) Let me put it another way, I don't think adding null to the json parser and incorporating it into this command is a good idea at this stage in the release so if we want to do something like this, we need to defer it to 0.13. I agree there are some instances where null could be useful. I think we can get away without it here though. -- Regards, Anthony Liguori