diff --git a/devicemodel/hw/pci/virtio/virtio_console.c b/devicemodel/hw/pci/virtio/virtio_console.c index 9f0ee923e..e7de20b7c 100644 --- a/devicemodel/hw/pci/virtio/virtio_console.c +++ b/devicemodel/hw/pci/virtio/virtio_console.c @@ -766,6 +766,13 @@ virtio_console_close_all(struct virtio_console *console) be = (struct virtio_console_backend *)port->arg; if (be) { + if (be->evp) { + if (be->fd != STDIN_FILENO) + mevent_delete_close(be->evp); + else + mevent_delete(be->evp); + } + virtio_console_close_backend(be); free(be); } diff --git a/devicemodel/hw/pci/virtio/virtio_net.c b/devicemodel/hw/pci/virtio/virtio_net.c index eeaf7a92b..10517aae1 100644 --- a/devicemodel/hw/pci/virtio/virtio_net.c +++ b/devicemodel/hw/pci/virtio/virtio_net.c @@ -1093,6 +1093,9 @@ virtio_net_deinit(struct vmctx *ctx, struct pci_vdev *dev, char *opts) } else fprintf(stderr, "net->tapfd is -1!\n"); + if (net->mevp != NULL) + mevent_delete(net->mevp); + free(net); DPRINTF(("%s: done\n", __func__));