提交 85d91e32 编写于 作者: H Hans de Goede 提交者: Anthony Liguori

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: NHans de Goede <hdegoede@redhat.com>
Message-id: 1364292483-16564-8-git-send-email-hdegoede@redhat.com
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 574b711a
......@@ -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;
}
}
......
......@@ -224,8 +224,6 @@ void qemu_chr_add_handlers(CharDriverState *s,
int fe_open;
if (!opaque && !fd_can_read && !fd_read && !fd_event) {
/* chr driver being released. */
++s->avail_connections;
fe_open = 0;
} else {
fe_open = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册