summaryrefslogtreecommitdiffstats
path: root/hw/qdev-properties.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-03-24 08:11:58 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2011-03-24 08:11:58 -0500
commit56d7a964a5664d3778a0b7a369a5f350d0fe099f (patch)
treea851ba09087f5291d2c412981efd6605118a9142 /hw/qdev-properties.c
parent24e838b787959eba0bc516d36224df2c6855d02a (diff)
parent2d6c1ef40f3678ab47a4d14fb5dadaa486bfcda6 (diff)
downloadhqemu-56d7a964a5664d3778a0b7a369a5f350d0fe099f.zip
hqemu-56d7a964a5664d3778a0b7a369a5f350d0fe099f.tar.gz
Merge remote branch 'amit/for-anthony' into staging
Diffstat (limited to 'hw/qdev-properties.c')
-rw-r--r--hw/qdev-properties.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
index a45b61e..1088a26 100644
--- a/hw/qdev-properties.c
+++ b/hw/qdev-properties.c
@@ -351,8 +351,13 @@ static int parse_chr(DeviceState *dev, Property *prop, const char *str)
CharDriverState **ptr = qdev_get_prop_ptr(dev, prop);
*ptr = qemu_chr_find(str);
- if (*ptr == NULL)
+ if (*ptr == NULL) {
return -ENOENT;
+ }
+ if ((*ptr)->assigned) {
+ return -EEXIST;
+ }
+ (*ptr)->assigned = 1;
return 0;
}
OpenPOWER on IntegriCloud