projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2ba6edf
)
qdev: Add help for property value
author
Stefan Weil
<weil@mail.berlios.de>
Wed, 20 Jan 2010 21:58:34 +0000
(22:58 +0100)
committer
Anthony Liguori
<aliguori@us.ibm.com>
Tue, 26 Jan 2010 21:42:01 +0000
(15:42 -0600)
When called with property value "?",
a help text will be printed (instead of an error message).
This is useful for command lines like
qemu -device e1000,mac=?
and is already standard for other command line options.
A better help text could be provided by extending
the Property structure with a desc field.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/qdev-properties.c
patch
|
blob
|
history
diff --git
a/hw/qdev-properties.c
b/hw/qdev-properties.c
index 8547ad27d492c8e1bb77fbf5319fb6f559f2011b..f5ca05fe871d3016d8084f6c4dfaa663467803c7 100644
(file)
--- a/
hw/qdev-properties.c
+++ b/
hw/qdev-properties.c
@@
-565,8
+565,13
@@
int qdev_prop_parse(DeviceState *dev, const char *name, const char *value)
return -1;
}
if (prop->info->parse(dev, prop, value) != 0) {
- fprintf(stderr, "property \"%s.%s\": failed to parse \"%s\"\n",
- dev->info->name, name, value);
+ if (strcmp(value, "?") != 0) {
+ fprintf(stderr, "property \"%s.%s\": failed to parse \"%s\"\n",
+ dev->info->name, name, value);
+ } else {
+ fprintf(stderr, "%s.%s=%s\n",
+ dev->info->name, name, prop->info->name);
+ }
return -1;
}
return 0;