[Top][All Lists]

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

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

From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference
Date: Fri, 16 Dec 2011 08:10:26 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110831 Lightning/1.0b2 Thunderbird/3.1.13

On 12/16/2011 08:00 AM, Paolo Bonzini wrote:
On 12/16/2011 02:55 PM, Anthony Liguori wrote:
This is visible with

qom-get path=/i440fx/piix3 property=romfile

after static non-string properties are introduced.

I'm a bit confused about what's happening here. What's the significance
of non-string properties?

Should have been "static non-legacy properties".

When you don't have a value for a property, legacy properties are visited as
"<null>", while the new static properties do not pass anything to the visitor.

I stole this from qdev_property_get_str:

value = prop->get(dev, errp);
if (value) {
visit_type_str(v, &value, name, errp);

I should more clearly document it. NULL would be only return if errp was set. I just didn't want to introduce a local_err in order to be able to check whether the function failed.

If a property function does not set the Error pointer, it must visit something.


Anthony Liguori


reply via email to

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