aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-03-26 11:07:59 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2013-03-27 10:26:49 -0500
commit85d91e3295f3af21e4d4a19f1f6691c0bf2ed10c (patch)
tree740fd4aca61192edd11ac64518e79d54fc4fdef6 /hw
parent574b711a92db094a2d4e7ca707f3b34437a64246 (diff)
qemu-char: Move incrementing of avail_connections to qdev-properties-system
The decrement of avail_connections is done in qdev-properties-system move the increment there too for proper balancing of the calls. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Message-id: 1364292483-16564-8-git-send-email-hdegoede@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/qdev-properties-system.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/qdev-properties-system.c b/hw/qdev-properties-system.c
index 28813d3978..d9934b5b9c 100644
--- a/hw/qdev-properties-system.c
+++ b/hw/qdev-properties-system.c
@@ -136,9 +136,11 @@ static void release_chr(Object *obj, const char *name, void *opaque)
DeviceState *dev = DEVICE(obj);
Property *prop = opaque;
CharDriverState **ptr = qdev_get_prop_ptr(dev, prop);
+ CharDriverState *chr = *ptr;
- if (*ptr) {
- qemu_chr_add_handlers(*ptr, NULL, NULL, NULL, NULL);
+ if (chr) {
+ qemu_chr_add_handlers(chr, NULL, NULL, NULL, NULL);
+ ++chr->avail_connections;
}
}