[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH 5/7] add qdev property type "cpu"
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] Re: [PATCH 5/7] add qdev property type "cpu" |
Date: |
Sun, 27 Jun 2010 14:48:42 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100621 Fedora/3.0.5-1.fc13 Lightning/1.0b2pre Thunderbird/3.0.5 |
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
Re: [Qemu-devel] [PATCH 5/7] add qdev property type "cpu", Blue Swirl, 2010/06/27
[Qemu-devel] [PATCH 2/7] include qemu-common.h when needed by the next patches, Paolo Bonzini, 2010/06/25
[Qemu-devel] [PATCH 3/7] include stdio.h freely, remove dyngen-exec.h hacks, Paolo Bonzini, 2010/06/25
[Qemu-devel] [PATCH 1/7] rtc: Remove TARGET_I386 from qemu-config.c, enables driftfix, Paolo Bonzini, 2010/06/25
Re: [Qemu-devel] [PATCH 0/7] poison TARGET_xxx for compile once object and header file cleanups, Richard Henderson, 2010/06/25
Re: [Qemu-devel] [PATCH 0/7] poison TARGET_xxx for compile once object and header file cleanups, Blue Swirl, 2010/06/27