+ backend->type = CHARDEV_BACKEND_KIND_SPICEPORT;
+ spiceport = backend->u.spiceport.data = g_new0(ChardevSpicePort, 1);
+ qemu_chr_parse_common(opts, qapi_ChardevSpicePort_base(spiceport));
+ spiceport->fqdn = g_strdup(name);
+}
+
+static void char_spice_class_init(ObjectClass *oc, void *data)
+{
+ ChardevClass *cc = CHARDEV_CLASS(oc);
+
+ cc->chr_write = spice_chr_write;
+ cc->chr_add_watch = spice_chr_add_watch;
+ cc->chr_accept_input = spice_chr_accept_input;
+}
+
+static const TypeInfo char_spice_type_info = {
+ .name = TYPE_CHARDEV_SPICE,
+ .parent = TYPE_CHARDEV,
+ .instance_size = sizeof(SpiceChardev),
+ .instance_finalize = char_spice_finalize,
+ .class_init = char_spice_class_init,
+ .abstract = true,
+};
+
+static void char_spicevmc_class_init(ObjectClass *oc, void *data)
+{
+ ChardevClass *cc = CHARDEV_CLASS(oc);
+
+ cc->parse = qemu_chr_parse_spice_vmc;
+ cc->open = qemu_chr_open_spice_vmc;
+ cc->chr_set_fe_open = spice_vmc_set_fe_open;