[{"id":1775100,"web_url":"http://patchwork.ozlabs.org/comment/1775100/","msgid":"<20170926024241.GH19505@pxdev.xzpeter.org>","list_archive_url":null,"date":"2017-09-26T02:42:41","subject":"Re: [Qemu-devel] [PATCH v2 3/6] migration: Check field save returns","submitter":{"id":67717,"url":"http://patchwork.ozlabs.org/api/people/67717/","name":"Peter Xu","email":"peterx@redhat.com"},"content":"On Mon, Sep 25, 2017 at 12:29:14PM +0100, Dr. David Alan Gilbert (git) wrote:\n> From: \"Dr. David Alan Gilbert\" <dgilbert@redhat.com>\n> \n> Check the return values from vmstate_save_state for fields and also the\n> return values from 'put' for fields that use that.\n> \n> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>\n> ---\n>  migration/vmstate.c | 15 ++++++++++++---\n>  1 file changed, 12 insertions(+), 3 deletions(-)\n> \n> diff --git a/migration/vmstate.c b/migration/vmstate.c\n> index ae8abd3c32..848e8448c6 100644\n> --- a/migration/vmstate.c\n> +++ b/migration/vmstate.c\n> @@ -347,6 +347,7 @@ int vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd,\n>              }\n>              for (i = 0; i < n_elems; i++) {\n>                  void *curr_elem = first_elem + size * i;\n> +                ret = 0;\n>  \n>                  vmsd_desc_field_start(vmsd, vmdesc_loop, field, i, n_elems);\n>                  old_offset = qemu_ftell_fast(f);\n> @@ -357,11 +358,19 @@ int vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd,\n>                  if (!curr_elem && size) {\n>                      /* if null pointer write placeholder and do not follow */\n>                      assert(field->flags & VMS_ARRAY_OF_POINTER);\n> -                    vmstate_info_nullptr.put(f, curr_elem, size, NULL, NULL);\n> +                    ret = vmstate_info_nullptr.put(f, curr_elem, size, NULL,\n> +                                                   NULL);\n>                  } else if (field->flags & VMS_STRUCT) {\n> -                    vmstate_save_state(f, field->vmsd, curr_elem, vmdesc_loop);\n> +                    ret = vmstate_save_state(f, field->vmsd, curr_elem,\n> +                                             vmdesc_loop);\n>                  } else {\n> -                    field->info->put(f, curr_elem, size, field, vmdesc_loop);\n> +                    ret = field->info->put(f, curr_elem, size, field,\n> +                                     vmdesc_loop);\n> +                }\n> +                if (ret) {\n> +                    error_report(\"Save of field %s/%s failed\",\n> +                                 vmsd->name, field->name);\n\nI would prefer to prefix the function name (also there is one\nerror_report in previous patch) but that's optional.\n\nReviewed-by: Peter Xu <peterx@redhat.com>\n\n> +                    return ret;\n>                  }\n>  \n>                  written_bytes = qemu_ftell_fast(f) - old_offset;\n> -- \n> 2.13.5\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=peterx@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y1QHV3L70z9sxR\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 26 Sep 2017 12:43:17 +1000 (AEST)","from localhost ([::1]:45282 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dwfq6-0001DK-PA\n\tfor incoming@patchwork.ozlabs.org; Mon, 25 Sep 2017 22:43:14 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:52370)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <peterx@redhat.com>) id 1dwfpk-0001DF-Sk\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 22:42:53 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <peterx@redhat.com>) id 1dwfph-0000c1-11\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 22:42:52 -0400","from mx1.redhat.com ([209.132.183.28]:58316)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <peterx@redhat.com>) id 1dwfpg-0000bh-Nu\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 22:42:48 -0400","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 885FDA78B;\n\tTue, 26 Sep 2017 02:42:47 +0000 (UTC)","from pxdev.xzpeter.org (dhcp-15-224.nay.redhat.com [10.66.15.224])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 548A1784B4;\n\tTue, 26 Sep 2017 02:42:43 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 885FDA78B","Date":"Tue, 26 Sep 2017 10:42:41 +0800","From":"Peter Xu <peterx@redhat.com>","To":"\"Dr. David Alan Gilbert (git)\" <dgilbert@redhat.com>","Message-ID":"<20170926024241.GH19505@pxdev.xzpeter.org>","References":"<20170925112917.21340-1-dgilbert@redhat.com>\n\t<20170925112917.21340-4-dgilbert@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20170925112917.21340-4-dgilbert@redhat.com>","User-Agent":"Mutt/1.5.24 (2015-08-30)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.13","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.29]);\n\tTue, 26 Sep 2017 02:42:47 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v2 3/6] migration: Check field save returns","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"peter.maydell@linaro.org, famz@redhat.com, quintela@redhat.com,\n\tcohuck@redhat.com, qemu-devel@nongnu.org, rth@twiddle.net","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1775501,"web_url":"http://patchwork.ozlabs.org/comment/1775501/","msgid":"<20170926153223.234b2b22.cohuck@redhat.com>","list_archive_url":null,"date":"2017-09-26T13:32:23","subject":"Re: [Qemu-devel] [PATCH v2 3/6] migration: Check field save returns","submitter":{"id":71914,"url":"http://patchwork.ozlabs.org/api/people/71914/","name":"Cornelia Huck","email":"cohuck@redhat.com"},"content":"On Mon, 25 Sep 2017 12:29:14 +0100\n\"Dr. David Alan Gilbert (git)\" <dgilbert@redhat.com> wrote:\n\n> From: \"Dr. David Alan Gilbert\" <dgilbert@redhat.com>\n> \n> Check the return values from vmstate_save_state for fields and also the\n> return values from 'put' for fields that use that.\n> \n> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>\n> ---\n>  migration/vmstate.c | 15 ++++++++++++---\n>  1 file changed, 12 insertions(+), 3 deletions(-)\n\nReviewed-by: Cornelia Huck <cohuck@redhat.com>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=cohuck@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y1hjQ205nz9tXH\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 26 Sep 2017 23:33:14 +1000 (AEST)","from localhost ([::1]:47574 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dwpz6-0003Rm-Ag\n\tfor incoming@patchwork.ozlabs.org; Tue, 26 Sep 2017 09:33:12 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:47751)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <cohuck@redhat.com>) id 1dwpyU-0003O4-7K\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 09:32:40 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <cohuck@redhat.com>) id 1dwpyT-0004i7-Ct\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 09:32:34 -0400","from mx1.redhat.com ([209.132.183.28]:34272)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <cohuck@redhat.com>) id 1dwpyT-0004hW-6G\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 09:32:33 -0400","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 34132356F9;\n\tTue, 26 Sep 2017 13:32:32 +0000 (UTC)","from gondolin (dhcp-192-215.str.redhat.com [10.33.192.215])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 908F95EDF1;\n\tTue, 26 Sep 2017 13:32:25 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 34132356F9","Date":"Tue, 26 Sep 2017 15:32:23 +0200","From":"Cornelia Huck <cohuck@redhat.com>","To":"\"Dr. David Alan Gilbert (git)\" <dgilbert@redhat.com>","Message-ID":"<20170926153223.234b2b22.cohuck@redhat.com>","In-Reply-To":"<20170925112917.21340-4-dgilbert@redhat.com>","References":"<20170925112917.21340-1-dgilbert@redhat.com>\n\t<20170925112917.21340-4-dgilbert@redhat.com>","Organization":"Red Hat GmbH","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tTue, 26 Sep 2017 13:32:32 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v2 3/6] migration: Check field save returns","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"peter.maydell@linaro.org, famz@redhat.com, quintela@redhat.com,\n\tqemu-devel@nongnu.org, peterx@redhat.com, rth@twiddle.net","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1776149,"web_url":"http://patchwork.ozlabs.org/comment/1776149/","msgid":"<87wp4kbjqh.fsf@secure.laptop>","list_archive_url":null,"date":"2017-09-27T08:59:02","subject":"Re: [Qemu-devel] [PATCH v2 3/6] migration: Check field save returns","submitter":{"id":2643,"url":"http://patchwork.ozlabs.org/api/people/2643/","name":"Juan Quintela","email":"quintela@redhat.com"},"content":"\"Dr. David Alan Gilbert (git)\" <dgilbert@redhat.com> wrote:\n> From: \"Dr. David Alan Gilbert\" <dgilbert@redhat.com>\n>\n> Check the return values from vmstate_save_state for fields and also the\n> return values from 'put' for fields that use that.\n>\n> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>\n\nReviewed-by: Juan Quintela <quintela@redhat.com>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=quintela@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y2BfS30PRz9tXM\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 19:02:24 +1000 (AEST)","from localhost ([::1]:53493 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dx8EY-0005g8-HN\n\tfor incoming@patchwork.ozlabs.org; Wed, 27 Sep 2017 05:02:22 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:47784)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <quintela@redhat.com>) id 1dx8BQ-0003HJ-13\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 04:59:11 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <quintela@redhat.com>) id 1dx8BK-0003Rw-KV\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 04:59:08 -0400","from mx1.redhat.com ([209.132.183.28]:60828)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <quintela@redhat.com>) id 1dx8BK-0003Rc-FZ\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 04:59:02 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 7744E5F7BD;\n\tWed, 27 Sep 2017 08:59:01 +0000 (UTC)","from localhost (ovpn-117-142.ams2.redhat.com [10.36.117.142])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 7EE7377E5E;\n\tWed, 27 Sep 2017 08:58:56 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 7744E5F7BD","From":"Juan Quintela <quintela@redhat.com>","To":"\"Dr. David Alan Gilbert \\(git\\)\" <dgilbert@redhat.com>","In-Reply-To":"<20170925112917.21340-4-dgilbert@redhat.com> (David Alan\n\tGilbert's message of \"Mon, 25 Sep 2017 12:29:14 +0100\")","References":"<20170925112917.21340-1-dgilbert@redhat.com>\n\t<20170925112917.21340-4-dgilbert@redhat.com>","User-Agent":"Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)","Date":"Wed, 27 Sep 2017 10:59:02 +0200","Message-ID":"<87wp4kbjqh.fsf@secure.laptop>","MIME-Version":"1.0","Content-Type":"text/plain","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.39]);\n\tWed, 27 Sep 2017 08:59:01 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v2 3/6] migration: Check field save returns","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"quintela@redhat.com","Cc":"peter.maydell@linaro.org, famz@redhat.com, cohuck@redhat.com,\n\tqemu-devel@nongnu.org, peterx@redhat.com, rth@twiddle.net","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]