Hmm. Parse method doesn't accept output of the print method. Not so
nice. Is the "CPU #" decoration essential?
I noticed the same in parse/print string:
static int parse_string(DeviceState *dev, Property *prop, const char *str)
{
char **ptr = qdev_get_prop_ptr(dev, prop);
if (*ptr)
qemu_free(*ptr);
*ptr = qemu_strdup(str);
return 0;
}
static int print_string(DeviceState *dev, Property *prop, char *dest,
size_t len)
{
char **ptr = qdev_get_prop_ptr(dev, prop);
if (!*ptr)
return snprintf(dest, len, "<null>");
return snprintf(dest, len, "\"%s\"", *ptr);
}
It looks like printing representation is chosen "for the user", not for
parsing.
Paolo