[Top][All Lists]

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

Re: [Qemu-devel] [PATCH 02/18] qom: register legacy properties as new st

From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 02/18] qom: register legacy properties as new style properties
Date: Thu, 01 Dec 2011 19:03:19 -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/01/2011 09:51 AM, Gerd Hoffmann wrote:

+    for (prop = dev->info->props; prop&&  prop->name; prop++) {
+        qdev_property_add_legacy(dev, prop, NULL);
+    }

bus properties?

Hrm, okay, I can fix that.  Thanks for pointing that out.

+static void qdev_get_legacy_property(DeviceState *dev, Visitor *v, void 
+                                     const char *name, Error **errp)
+    Property *prop = opaque;
+    if (prop->info->print) {
+        char buffer[1024];
+        char *ptr = buffer;
+        prop->info->print(dev, prop, buffer, sizeof(buffer));
+        visit_type_str(v,&ptr, name, errp);

I think you can look at prop->info->type here and do something more
clever at least for the bool + integer properties.

That might get a little tough because I want legacy<> types to be handled as strings. I guess we could promote bool/int to non-legacy types.


Anthony Liguori


reply via email to

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