qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference
Date: Fri, 16 Dec 2011 17:17:09 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1

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 <null>.

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]