From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbaTD-0004BY-Bg for qemu-devel@nongnu.org; Fri, 16 Dec 2011 11:17:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RbaTC-0006o4-Ek for qemu-devel@nongnu.org; Fri, 16 Dec 2011 11:17:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbaTC-0006ny-84 for qemu-devel@nongnu.org; Fri, 16 Dec 2011 11:17:14 -0500 Message-ID: <4EEB6F05.3020807@redhat.com> Date: Fri, 16 Dec 2011 17:17:09 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1324036918-2405-1-git-send-email-pbonzini@redhat.com> <1324036918-2405-2-git-send-email-pbonzini@redhat.com> <4EEB4DE2.2060805@codemonkey.ws> <4EEB4F0C.7050702@redhat.com> <4EEB5152.2010405@codemonkey.ws> <4EEB543C.5030104@redhat.com> <4EEB59CE.809@codemonkey.ws> <4EEB5A6D.4080705@redhat.com> <4EEB5C11.5040907@codemonkey.ws> <4EEB5DD4.50302@redhat.com> <4EEB5E52.7090204@codemonkey.ws> <4EEB600A.50803@redhat.com> <4EEB6278.6070401@codemonkey.ws> <4EEB66D0.7090006@redhat.com> <4EEB69BE.2070103@codemonkey.ws> In-Reply-To: <4EEB69BE.2070103@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: kwolf@redhat.com, qemu-devel@nongnu.org On 12/16/2011 04:54 PM, Anthony Liguori wrote: > On 12/16/2011 09:42 AM, Paolo Bonzini wrote: >> On 12/16/2011 04:23 PM, Anthony Liguori wrote: >>> Ok. I think nullable strings are not a good idea simply because it >>> means that a property can have a state that cannot be set. >> >> How is this different from NULL links? (Honest, not trick question :)). > > An empty string == NULL for links. > > If a pointer is NULL, an empty string is returned. So get/set is full > symmetric. Ok, so we can do the same for "pointer" properties. I'm just a bit worried about serial numbers, where "-device virtio-blk-pci,...,serial=" is different from no serial at all. One shows "" in info qtree, the other shows . > For JSON, but it doesn't map to a config file easily nor does it map to > command line syntax well. You can force nullable properties to have a null default (which is now the case in qdev), but I agree that's not too nice. Paolo