From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3O0g-0005yE-1k for qemu-devel@nongnu.org; Mon, 30 Nov 2015 07:56:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3O0d-00074w-AG for qemu-devel@nongnu.org; Mon, 30 Nov 2015 07:56:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33759) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3O0d-00074L-5I for qemu-devel@nongnu.org; Mon, 30 Nov 2015 07:56:47 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id C916C8E379 for ; Mon, 30 Nov 2015 12:56:46 +0000 (UTC) References: <1448883140-20249-1-git-send-email-peterx@redhat.com> <1448883140-20249-11-git-send-email-peterx@redhat.com> From: Paolo Bonzini Message-ID: <565C478A.8080106@redhat.com> Date: Mon, 30 Nov 2015 13:56:42 +0100 MIME-Version: 1.0 In-Reply-To: <1448883140-20249-11-git-send-email-peterx@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 10/12] Dump: add qmp command "query-dump" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Xu , qemu-devel@nongnu.org Cc: drjones@redhat.com, famz@redhat.com, lersek@redhat.com, armbru@redhat.com, lcapitulino@redhat.com On 30/11/2015 12:32, Peter Xu wrote: > +{ > + DumpQueryResult *result = g_malloc0(sizeof(*result)); > + DumpState *state = dump_state_get_global(); > + result->status = state->status; > + result->written_bytes = state->written_size; You need a mutex around the reads of ->status and ->written_size. Paolo > + result->total_bytes = state->total_size; > + return result;