From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gC7Or-0006St-RI for qemu-devel@nongnu.org; Mon, 15 Oct 2018 14:15:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gC7Oj-00014v-K6 for qemu-devel@nongnu.org; Mon, 15 Oct 2018 14:15:27 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:55812) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gC7Og-0000yM-Aa for qemu-devel@nongnu.org; Mon, 15 Oct 2018 14:15:18 -0400 Received: by mail-wm1-x344.google.com with SMTP id 206-v6so19891545wmb.5 for ; Mon, 15 Oct 2018 11:15:16 -0700 (PDT) References: <20181005154910.3099-1-alex.bennee@linaro.org> <20181005154910.3099-20-alex.bennee@linaro.org> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: Date: Mon, 15 Oct 2018 19:15:13 +0100 Message-ID: <87in233wlq.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH 19/21] plugins: add an example hotblocks plugin List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org, Stefan Hajnoczi , cota@braap.org, vilanova@ac.upc.edu, Pavel.Dovgaluk@ispras.ru Richard Henderson writes: > On 10/5/18 8:49 AM, Alex Benn=C3=A9e wrote: >> +char *plugin_status(void) >> +{ >> + GString *report =3D g_string_new("We have "); >> + char *r; >> + g_mutex_lock(&lock); >> + g_string_append_printf(report, "%ud entries in the hash table\n", >> + g_hash_table_size(hotblocks)); >> + g_mutex_unlock(&lock); >> + r =3D report->str; >> + g_string_free(report, FALSE); >> + return r; >> +} > > You're not reporting the entries themselves? > Also, are you sure you don't want to just return the GString? I considered it. I wondered if exposing a glib dependency to the plugins was fair game? It would make things simpler and QEMU could even allocate it for the plugin. > > > r~ -- Alex Benn=C3=A9e