qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v6 8/9] chardev/char.c: Check for duplicate id before creatin


From: Lukas Straub
Subject: Re: [PATCH v6 8/9] chardev/char.c: Check for duplicate id before creating chardev
Date: Fri, 31 Jul 2020 15:29:52 +0200

On Fri, 31 Jul 2020 10:37:34 +0100
Daniel P. Berrangé <berrange@redhat.com> wrote:

> On Fri, Jul 31, 2020 at 11:27:04AM +0200, Lukas Straub wrote:
> > yank_register_instance (called when creating the new chardev object)
> > aborts if the instance already exists. So check for duplicate id before
> > creating the new chardev to prevent this.  
> 
> I feel the right answer here is for yank_register_instance to not
> use abort().
> 
> Instead have it take a 'Error **errp' and report the error normally.
> The caller can then propagate the errors in the same way it does
> for the duplicate ID errors. If a particular caller can't handle
> errors gracefully, then it can pass "&error_abort" to the
> yank_register_instance() to get the same abort semantics as now.
> 
> Regards,
> Daniel

Yes, makes sense for yank_register_instance not to kill qemu. Although (with 
this fix in) it always indicates a bug due to a leaked yank instance.

Regards,
Lukas Straub

Attachment: pgpGaDF_JtOwX.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]