提交 cd8f7df2 编写于 作者: H Hans de Goede 提交者: Amit Shah

spice-chardev: listen to frontend guest open / close

Note the vmc_register_interface() in spice_chr_write is left in place
in case someone uses spice-chardev with a frontend which does not have
guest open / close notification.
Signed-off-by: NHans de Goede <hdegoede@redhat.com>
Reviewed-by: NAlon Levy <alevy@redhat.com>
Signed-off-by: NAmit Shah <amit.shah@redhat.com>
上级 0b6d2266
......@@ -131,6 +131,18 @@ static void spice_chr_close(struct CharDriverState *chr)
qemu_free(s);
}
static void spice_chr_guest_open(struct CharDriverState *chr)
{
SpiceCharDriver *s = chr->opaque;
vmc_register_interface(s);
}
static void spice_chr_guest_close(struct CharDriverState *chr)
{
SpiceCharDriver *s = chr->opaque;
vmc_unregister_interface(s);
}
static void print_allowed_subtypes(void)
{
const char** psubtype;
......@@ -183,6 +195,8 @@ CharDriverState *qemu_chr_open_spice(QemuOpts *opts)
chr->opaque = s;
chr->chr_write = spice_chr_write;
chr->chr_close = spice_chr_close;
chr->chr_guest_open = spice_chr_guest_open;
chr->chr_guest_close = spice_chr_guest_close;
qemu_chr_generic_open(chr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册