On 11/8/21 09:46, Marc-André Lureau wrote:
+   QemuOpts *opts;

      chr = qemu_chr_find(id);
      if (chr == NULL) {
@@ -1175,6 +1177,10 @@ void qmp_chardev_remove(const char *id, Error **errp)
          return;
      }
      object_unparent(OBJECT(chr));
+    /* delete the opts reserved in vm_config_groups list.  */
+    opts = qemu_opts_find(qemu_find_opts("chardev"), id);
+    if (opts)
+        qemu_opts_del(opts);
That seems reasonable to me,
Reviewed-by: Marc-André Lureau<marcandre.lur...@redhat.com>

I think it should be done instead in an unparent function, i.e. with something like "oc->unparent = chr_unparent;" in char_class_init. chr_unparent does the qemu_opts_find/qemu_opts_del.

Thanks,

Paolo


Reply via email to