qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 07/18] qom: add link properties


From: Avi Kivity
Subject: Re: [Qemu-devel] [PATCH 07/18] qom: add link properties
Date: Thu, 01 Dec 2011 13:21:09 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0

On 11/30/2011 11:03 PM, Anthony Liguori wrote:
> Links represent an ephemeral relationship between devices.  They are meant to
> replace the qdev concept of busses by allowing more informal relationships
> between devices.

So, links are equivalent to pointers?

> Links are fairly limited in their usefulness without implementing QOM-style
> subclassing and interfaces.
>
>  
> +static void qdev_get_link_property(DeviceState *dev, Visitor *v, void 
> *opaque,
> +                                   const char *name, Error **errp)
> +{
> +    DeviceState **child = opaque;
> +    gchar *path;
> +
> +    if (*child) {
> +        path = qdev_get_canonical_path(*child);
> +        visit_type_str(v, &path, name, errp);
> +        g_free(path);
> +    } else {
> +        path = (gchar *)"";

If gchar != char, this is wrong.  Also, you're converting a const
pointer into a non-const pointer, discarding type safety.

> +        visit_type_str(v, &path, name, errp);
> +    }

Shouldn't this be visit_type_link()?


-- 
error compiling committee.c: too many arguments to function




reply via email to

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