From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEzUZ-0005vv-6b for qemu-devel@nongnu.org; Mon, 20 Jun 2016 09:44:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bEzUT-0002BQ-3U for qemu-devel@nongnu.org; Mon, 20 Jun 2016 09:43:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56337) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEzUS-0002B8-R0 for qemu-devel@nongnu.org; Mon, 20 Jun 2016 09:43:49 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B489E4621B for ; Mon, 20 Jun 2016 13:43:47 +0000 (UTC) Date: Mon, 20 Jun 2016 10:43:45 -0300 From: Eduardo Habkost Message-ID: <20160620134345.GA2048@thinpad.lan.raisama.net> References: <1466022773-8965-1-git-send-email-ehabkost@redhat.com> <1466022773-8965-5-git-send-email-ehabkost@redhat.com> <877fdkcmox.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <877fdkcmox.fsf@dusky.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH 04/10] qdev: Use error_prepend() for errors applying globals List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, Marcel Apfelbaum , Paolo Bonzini , Igor Mammedov On Mon, Jun 20, 2016 at 10:02:38AM +0200, Markus Armbruster wrote: > Eduardo Habkost writes: > > > The same Error* will be used in an error_propagate() call in the > > future, so prepend a "can't apply global" prefix to it. > > What future? A future patch? > > > Signed-off-by: Eduardo Habkost > > --- > > hw/core/qdev-properties.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c > > index 64e17aa..cd19603 100644 > > --- a/hw/core/qdev-properties.c > > +++ b/hw/core/qdev-properties.c > > @@ -1079,8 +1079,9 @@ static void qdev_prop_set_globals_for_type(DeviceState *dev, > > object_property_parse(OBJECT(dev), prop->value, prop->property, &err); > > if (err != NULL) { > > assert(prop->user_provided); > > - error_reportf_err(err, "Warning: global %s.%s=%s ignored: ", > > - prop->driver, prop->property, prop->value); > > + error_prepend(&err, "can't apply global %s.%s=%s: ", > > + prop->driver, prop->property, prop->value); > > + error_reportf_err(err, "Warning: "); > > } > > } > > } > > You reword the error message. Should be mentioned in the commit > message. Will mention in in the commit message in v2. > > Why do you need to prepend the "Warning: ..." in two steps, first > error_prepend() for the "...", then error_reportf_err() for "Warning: "? > Perhaps it'll become clear later in the series, but it's not obvious > now. The split is useful for patch 05/10. I will squash both patches, as you suggested in another message. Thanks! -- Eduardo