diff mbox series

[05/12] chardev: ensure qemu_chr_parse_compat reports missing driver error

Message ID 20190115145256.9593-6-berrange@redhat.com (mailing list archive)
State New, archived
Headers show
Series chardev: refactoring & many bugfixes related tcp_chr_wait_connected | expand

Commit Message

Daniel P. Berrangé Jan. 15, 2019, 2:52 p.m. UTC
If no valid char driver was identified the qemu_chr_parse_compat method
was silent, leaving callers no clue what failed.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 chardev/char.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Marc-André Lureau Jan. 15, 2019, 7:20 p.m. UTC | #1
Hi

On Tue, Jan 15, 2019 at 6:53 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> If no valid char driver was identified the qemu_chr_parse_compat method
> was silent, leaving callers no clue what failed.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  chardev/char.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/chardev/char.c b/chardev/char.c
> index ccba36bafb..b99f3692f7 100644
> --- a/chardev/char.c
> +++ b/chardev/char.c
> @@ -490,6 +490,8 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename,
>          return opts;
>      }
>
> +    error_report("'%s' is not a valid char driver", filename);
> +
>  fail:
>      qemu_opts_del(opts);
>      return NULL;
> --
> 2.20.1
>
diff mbox series

Patch

diff --git a/chardev/char.c b/chardev/char.c
index ccba36bafb..b99f3692f7 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -490,6 +490,8 @@  QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename,
         return opts;
     }
 
+    error_report("'%s' is not a valid char driver", filename);
+
 fail:
     qemu_opts_del(opts);
     return NULL;