qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4] log: Make glib logging go through QEMU


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v4] log: Make glib logging go through QEMU
Date: Thu, 3 Jan 2019 10:54:25 +0000
User-agent: Mutt/1.10.1 (2018-07-13)

On Fri, Dec 14, 2018 at 11:56:42AM +0100, Christophe Fergeau wrote:
> +static void qemu_log_func(const gchar *log_domain,
> +                          GLogLevelFlags log_level,
> +                          const gchar *message,
> +                          gpointer user_data)
> +{
> +    switch (log_level & G_LOG_LEVEL_MASK) {
> +    case G_LOG_LEVEL_DEBUG:
> +        /* Use same G_MESSAGES_DEBUG logic as glib to enable/disable debug
> +         * messages
> +         */
> +        if (qemu_glog_domains == NULL) {
> +            break;
> +        }
> +        if (strcmp(qemu_glog_domains, "all") != 0 &&
> +          (log_domain == NULL || !strstr(qemu_glog_domains, log_domain))) {
> +            break;
> +        }
> +        /* Fall through */
> +    case G_LOG_LEVEL_INFO:
> +        /* Fall through */
> +    case G_LOG_LEVEL_MESSAGE:
> +        info_report("%s: %s", log_domain, message);

QEMU itself uses glib, so what happens if *_report() emit more log
messages?  Can this result in an infinite loop?

Stefan

Attachment: signature.asc
Description: PGP signature


reply via email to

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