From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yzrfw-0002h5-1T for qemu-devel@nongnu.org; Tue, 02 Jun 2015 15:16:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yzrfv-0008Fm-4B for qemu-devel@nongnu.org; Tue, 02 Jun 2015 15:16:35 -0400 Message-ID: <556E0108.1050003@redhat.com> Date: Tue, 02 Jun 2015 15:16:24 -0400 From: John Snow MIME-Version: 1.0 References: <1433237561-10846-1-git-send-email-famz@redhat.com> <556D8266.8060004@msgid.tls.msk.ru> <20150602102637.GD22059@dhcp-14-238.nay.redhat.com> In-Reply-To: <20150602102637.GD22059@dhcp-14-238.nay.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] sheepdog: Fix error message if failed to load vmstate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , Michael Tokarev Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org, qemu-block@nongnu.org On 06/02/2015 06:26 AM, Fam Zheng wrote: > On Tue, 06/02 13:16, Michael Tokarev wrote: >> 02.06.2015 12:32, Fam Zheng wrote: >>> if (ret < 0) { >>> - error_report("failed to save vmstate %s", strerror(errno)); >>> + if (load) { >>> + error_report("failed to load vmstate %s", strerror(errno)); >>> + } else { >>> + error_report("failed to save vmstate %s", strerror(errno)); >>> + } >> >> + error_report("failed to %s vmstate: %s", load ? "load" : "save", strerror(errno)); > > The reason I didn't use a one-liner was, "git grep 'failed to load vmstate'" > in the code base would just work, besides my eyes also like the readability. > +1, Error messages should be kept on one line and intact where possible and convenient. Greppable code is happy code. >> >> (note also the addition of ":") > > Yes that applies to all error_report() in this file. > >> (besides what Kevin said). >> >> Thanks, > > Thanks, > > Fam >