From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDD4l-0003qe-T6 for qemu-devel@nongnu.org; Fri, 01 Aug 2014 09:40:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XDD4g-0007ic-9e for qemu-devel@nongnu.org; Fri, 01 Aug 2014 09:40:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44702) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDD4f-0007fd-Tj for qemu-devel@nongnu.org; Fri, 01 Aug 2014 09:40:46 -0400 Date: Fri, 1 Aug 2014 09:40:16 -0400 From: Luiz Capitulino Message-ID: <20140801094016.1bb90a30@redhat.com> In-Reply-To: <20140801133618.GA27316@thinpad.lan.raisama.net> References: <1406800053-6480-1-git-send-email-arei.gonglei@huawei.com> <1406800053-6480-2-git-send-email-arei.gonglei@huawei.com> <20140801133618.GA27316@thinpad.lan.raisama.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 1/8] bootindex: add modify_boot_device_path function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: chenliang88@huawei.com, weidong.huang@huawei.com, mst@redhat.com, aik@ozlabs.ru, hutao@cn.fujitsu.com, qemu-devel@nongnu.org, armbru@redhat.com, kraxel@redhat.com, akong@redhat.com, agraf@suse.de, arei.gonglei@huawei.com, aliguori@amazon.com, gaowanlong@cn.fujitsu.com, luonengjun@huawei.com, peter.huangpeng@huawei.com, hani@linux.com, stefanha@redhat.com, pbonzini@redhat.com, kwolf@redhat.com, peter.crosthwaite@xilinx.com, imammedo@redhat.com, afaerber@suse.de On Fri, 1 Aug 2014 10:36:18 -0300 Eduardo Habkost wrote: > On Thu, Jul 31, 2014 at 05:47:26PM +0800, arei.gonglei@huawei.com wrote: > [...] > > +void modify_boot_device_path(int32_t bootindex, DeviceState *dev, > > + const char *suffix) > > +{ > > + FWBootEntry *i, *old_entry = NULL; > > + > > + assert(dev != NULL || suffix != NULL); > > + > > + if (bootindex >= 0) { > > + QTAILQ_FOREACH(i, &fw_boot_order, link) { > > + if (i->bootindex == bootindex) { > > + qerror_report(ERROR_CLASS_GENERIC_ERROR, > > + "The bootindex %d has already been used", > > + bootindex); > > Isn't an Error** parameter preferable here, instead of using qerror_report()? Good catch. I'm not following this series, but using qerror_report() is almost always wrong these days.