From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVZtn-0006pv-Pm for qemu-devel@nongnu.org; Tue, 16 Feb 2016 02:18:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVZti-0007Gp-QJ for qemu-devel@nongnu.org; Tue, 16 Feb 2016 02:18:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36228) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVZti-0007Gf-LF for qemu-devel@nongnu.org; Tue, 16 Feb 2016 02:18:10 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 6469F8F4E1 for ; Tue, 16 Feb 2016 07:18:10 +0000 (UTC) Date: Tue, 16 Feb 2016 15:18:03 +0800 From: Peter Xu Message-ID: <20160216071803.GG7978@pxdev.xzpeter.org> References: <1449628943-10197-1-git-send-email-peterx@redhat.com> <1449628943-10197-11-git-send-email-peterx@redhat.com> <20160216064615.GG18664@ad.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160216064615.GG18664@ad.usersys.redhat.com> Subject: Re: [Qemu-devel] [PATCH v6 10/11] Dump: add hmp command "info dump" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: drjones@redhat.com, lersek@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, pbonzini@redhat.com, lcapitulino@redhat.com On Tue, Feb 16, 2016 at 02:46:15PM +0800, Fam Zheng wrote: > On Wed, 12/09 10:42, Peter Xu wrote: > > + > > +void hmp_info_dump(Monitor *mon, const QDict *qdict) > > +{ > > + DumpQueryResult *result = qmp_query_dump(NULL); > > If something goes wrong, it is probably better to pass in local_err to > qmp_query_dump and print the error info instead of assuming result's fields are > all valid and trying to interpret them. > > Fam This is because qmp_query_dump() will never fail, and it's not using errp. Will assert "result" too before use. Thanks. Peter