chr->opaque = s;
chr->chr_write = pty_chr_write;
chr->chr_update_read_handler = pty_chr_update_read_handler;
- chr->chr_close = pty_chr_close;
+ chr->chr_free = pty_chr_free;
chr->chr_add_watch = pty_chr_add_watch;
- chr->explicit_be_open = true;
+ *be_opened = false;
s->ioc = QIO_CHANNEL(qio_channel_file_new_fd(master_fd));
+ name = g_strdup_printf("chardev-pty-%s", chr->label);
+ qio_channel_set_name(QIO_CHANNEL(s->ioc), name);
+ g_free(name);
s->timer_tag = 0;
return chr;
object_unref(OBJECT(sioc));
return NULL;
}
- return qemu_chr_open_udp(sioc, common, be_opened, errp);
- chr = qemu_chr_open_udp(sioc, common, errp);
++ chr = qemu_chr_open_udp(sioc, common, be_opened, errp);
+
+ name = g_strdup_printf("chardev-udp-%s", chr->label);
+ qio_channel_set_name(QIO_CHANNEL(sioc), name);
+ g_free(name);
+
+ return chr;
}